Fixed LUT data editor bug.

This commit is contained in:
hneemann 2016-11-16 17:53:30 +01:00
parent f73e223fbe
commit 9f7fe517cd
2 changed files with 9 additions and 2 deletions

View File

@ -24,7 +24,7 @@ public class LookUpTable extends Node implements Element {
int size = elementAttributes.get(Keys.INPUT_COUNT);
PinDescription[] names = new PinDescription[size];
for (int i = 0; i < size; i++)
names[i] = input("in_" + i);
names[i] = input(Integer.toString(i));
return new PinDescriptions(names);
}
}

View File

@ -261,7 +261,14 @@ public final class EditorFactory {
@Override
public void actionPerformed(ActionEvent e) {
int bits = attr.get(Keys.BITS);
int size = 1 << attr.get(Keys.ADDR_BITS);
int size;
if (attr.contains(Keys.INPUT_COUNT)) {
// used to handle the LUT
size = 1 << attr.get(Keys.INPUT_COUNT);
} else {
// memory, RAM/ROM
size = 1 << attr.get(Keys.ADDR_BITS);
}
DataEditor de = new DataEditor(panel, data, size, bits, false, NoSync.INST);
if (de.showDialog()) {
data = de.getModifiedDataField();