|
@@ -14,10 +14,6 @@ public class EspressoFormatter {
|
|
private EspressoFormatter() {};
|
|
private EspressoFormatter() {};
|
|
|
|
|
|
public static String formatEspressoTableHeader(PALSpecs pSpecs, int ioAsOutMask) {
|
|
public static String formatEspressoTableHeader(PALSpecs pSpecs, int ioAsOutMask) {
|
|
- return formatEspressoTableHeader(pSpecs, ioAsOutMask, false);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public static String formatEspressoTableHeader(PALSpecs pSpecs, int ioAsOutMask, boolean ignoreFeedbacks) {
|
|
|
|
StringBuffer strBuf = new StringBuffer();
|
|
StringBuffer strBuf = new StringBuffer();
|
|
int ioAsOut_W = BitUtils.scatterBitField(BitUtils.consolidateBitField(ioAsOutMask, pSpecs.getMask_IO_R()), pSpecs.getMask_IO_W());
|
|
int ioAsOut_W = BitUtils.scatterBitField(BitUtils.consolidateBitField(ioAsOutMask, pSpecs.getMask_IO_R()), pSpecs.getMask_IO_W());
|
|
int io_outCount = BitUtils.countBits(ioAsOutMask);
|
|
int io_outCount = BitUtils.countBits(ioAsOutMask);
|
|
@@ -25,7 +21,7 @@ public class EspressoFormatter {
|
|
|
|
|
|
int outCount = pSpecs.getPinCount_O() + io_outCount + pSpecs.getPinCount_RO();
|
|
int outCount = pSpecs.getPinCount_O() + io_outCount + pSpecs.getPinCount_RO();
|
|
int outCount_oe = pSpecs.getPinCount_O() + io_outCount;
|
|
int outCount_oe = pSpecs.getPinCount_O() + io_outCount;
|
|
- int inCount = pSpecs.getPinCount_IN() + io_inCount + (ignoreFeedbacks ? 0 : io_outCount) + pSpecs.getPinCount_RO();
|
|
|
|
|
|
+ int inCount = pSpecs.getPinCount_IN() + io_inCount + io_outCount + pSpecs.getPinCount_RO();
|
|
|
|
|
|
strBuf.append("# " + pSpecs.toString() + "\n");
|
|
strBuf.append("# " + pSpecs.toString() + "\n");
|
|
strBuf.append(".i " + inCount + "\n"); // Inputs, IO as inputs, IO as outputs (as feedbacks), registered outputs (as feedbacks)
|
|
strBuf.append(".i " + inCount + "\n"); // Inputs, IO as inputs, IO as outputs (as feedbacks), registered outputs (as feedbacks)
|
|
@@ -34,7 +30,7 @@ public class EspressoFormatter {
|
|
strBuf.append(".ilb ");
|
|
strBuf.append(".ilb ");
|
|
for(int idx = 0; idx < 32; idx++) if(((pSpecs.getMask_IN() >> idx) & 0x01) > 0) strBuf.append(pSpecs.getLabels_IN()[idx] + " ");
|
|
for(int idx = 0; idx < 32; idx++) if(((pSpecs.getMask_IN() >> idx) & 0x01) > 0) strBuf.append(pSpecs.getLabels_IN()[idx] + " ");
|
|
for(int idx = 0; idx < 32; idx++) if((((pSpecs.getMask_IO_W() & ~ioAsOut_W) >> idx) & 0x01) > 0) strBuf.append(pSpecs.getLabels_IO()[idx] + " ");
|
|
for(int idx = 0; idx < 32; idx++) if((((pSpecs.getMask_IO_W() & ~ioAsOut_W) >> idx) & 0x01) > 0) strBuf.append(pSpecs.getLabels_IO()[idx] + " ");
|
|
- if(!ignoreFeedbacks) for(int idx = 0; idx < 32; idx++) if((((pSpecs.getMask_IO_W() & ioAsOut_W) >> idx) & 0x01) > 0) strBuf.append("f" + pSpecs.getLabels_IO()[idx] + " ");
|
|
|
|
|
|
+ for(int idx = 0; idx < 32; idx++) if((((pSpecs.getMask_IO_W() & ioAsOut_W) >> idx) & 0x01) > 0) strBuf.append("f" + pSpecs.getLabels_IO()[idx] + " ");
|
|
for(int idx = 0; idx < 32; idx++) if(((pSpecs.getMask_RO_W() >> idx) & 0x01) > 0) strBuf.append("ps"+pSpecs.getLabels_RO()[idx] + " ");
|
|
for(int idx = 0; idx < 32; idx++) if(((pSpecs.getMask_RO_W() >> idx) & 0x01) > 0) strBuf.append("ps"+pSpecs.getLabels_RO()[idx] + " ");
|
|
strBuf.append("\n");
|
|
strBuf.append("\n");
|
|
|
|
|
|
@@ -86,14 +82,10 @@ public class EspressoFormatter {
|
|
int io_fio_count = BitUtils.countBits(pSpecs.getMask_IO_R() & ioAsOutMask);
|
|
int io_fio_count = BitUtils.countBits(pSpecs.getMask_IO_R() & ioAsOutMask);
|
|
for(int idx = 0; idx < pSpecs.getPinCount_IN(); idx++) strBuf.append((char)(((ins >> idx) & 0x01) + 0x30));
|
|
for(int idx = 0; idx < pSpecs.getPinCount_IN(); idx++) strBuf.append((char)(((ins >> idx) & 0x01) + 0x30));
|
|
for(int idx = 0; idx < io_ins_count; idx++) strBuf.append((char)(((io_ins >> idx) & 0x01) + 0x30));
|
|
for(int idx = 0; idx < io_ins_count; idx++) strBuf.append((char)(((io_ins >> idx) & 0x01) + 0x30));
|
|
-
|
|
|
|
- if(!ignoreFeedbacks) {
|
|
|
|
- for(int idx = 0; idx < io_fio_count; idx++) {
|
|
|
|
- boolean fio_pin_hiz = ((io_fio_hiz >> idx) & 0x01) != 0;
|
|
|
|
- strBuf.append(fio_pin_hiz ? '-' : (char)(((io_fio >> idx) & 0x01) + 0x30));
|
|
|
|
- }
|
|
|
|
|
|
+ for(int idx = 0; idx < io_fio_count; idx++) {
|
|
|
|
+ boolean fio_pin_hiz = ((io_fio_hiz >> idx) & 0x01) != 0;
|
|
|
|
+ strBuf.append((fio_pin_hiz || ignoreFeedbacks) ? '-' : (char)(((io_fio >> idx) & 0x01) + 0x30));
|
|
}
|
|
}
|
|
-
|
|
|
|
for(int idx = 0; idx < pSpecs.getPinCount_RO(); idx++) strBuf.append((char)(((ro_ps >> idx) & 0x01) + 0x30));
|
|
for(int idx = 0; idx < pSpecs.getPinCount_RO(); idx++) strBuf.append((char)(((ro_ps >> idx) & 0x01) + 0x30));
|
|
|
|
|
|
strBuf.append(' ');
|
|
strBuf.append(' ');
|
|
@@ -138,11 +130,9 @@ public class EspressoFormatter {
|
|
for(int idx = 0; idx < pSpecs.getPinCount_IN(); idx++) strBuf.append((char)(((ins >> idx) & 0x01) + 0x30));
|
|
for(int idx = 0; idx < pSpecs.getPinCount_IN(); idx++) strBuf.append((char)(((ins >> idx) & 0x01) + 0x30));
|
|
for(int idx = 0; idx < io_ins_count; idx++) strBuf.append((char)(((io_ins >> idx) & 0x01) + 0x30));
|
|
for(int idx = 0; idx < io_ins_count; idx++) strBuf.append((char)(((io_ins >> idx) & 0x01) + 0x30));
|
|
|
|
|
|
- if(!ignoreFeedbacks) {
|
|
|
|
- for(int idx = 0; idx < io_fio_count; idx++) {
|
|
|
|
- boolean fio_pin_hiz = ((io_fio_hiz >> idx) & 0x01) != 0;
|
|
|
|
- strBuf.append(fio_pin_hiz ? '-' : (char)(((io_fio >> idx) & 0x01) + 0x30));
|
|
|
|
- }
|
|
|
|
|
|
+ for(int idx = 0; idx < io_fio_count; idx++) {
|
|
|
|
+ boolean fio_pin_hiz = ((io_fio_hiz >> idx) & 0x01) != 0;
|
|
|
|
+ strBuf.append((fio_pin_hiz || ignoreFeedbacks) ? '-' : (char)(((io_fio >> idx) & 0x01) + 0x30));
|
|
}
|
|
}
|
|
|
|
|
|
for(int idx = 0; idx < pSpecs.getPinCount_RO(); idx++) strBuf.append((char)(((ro_ps >> idx) & 0x01) + 0x30));
|
|
for(int idx = 0; idx < pSpecs.getPinCount_RO(); idx++) strBuf.append((char)(((ro_ps >> idx) & 0x01) + 0x30));
|