fixed a Bug in the RAMSinglePortSel component: Write was not edge-triggered on WE. Now it is.

This commit is contained in:
hneemann 2017-11-08 18:04:38 +01:00
parent 85283db343
commit a7811c3e38
3 changed files with 12 additions and 2 deletions

View File

@ -1,5 +1,10 @@
Release Notes
HEAD, planned as v0.16
- RAM components now allow an input invert configuration
- Bug fixes
- fixed a Bug in the RAMSinglePortSel component: Write was not edge-triggered on WE. Now it is.
v0.15, released on 30. Oct 2017
- Added the possibility to use custom, java implemented components in Digital.
- Added an EEPROM which behaves like a memory that can be written and whose content

View File

@ -31,7 +31,8 @@ public class RAMSinglePortSel extends Node implements Element, RAMInterface {
.addAttribute(Keys.ROTATE)
.addAttribute(Keys.BITS)
.addAttribute(Keys.ADDR_BITS)
.addAttribute(Keys.LABEL);
.addAttribute(Keys.LABEL)
.addAttribute(Keys.INVERTER_CONFIG);
private final int bits;
private final int addrBits;
@ -48,6 +49,7 @@ public class RAMSinglePortSel extends Node implements Element, RAMInterface {
private boolean cs;
private int addr;
private boolean oe;
private boolean lastweIn;
/**
* Creates a new instance
@ -86,15 +88,17 @@ public class RAMSinglePortSel extends Node implements Element, RAMInterface {
@Override
public void readInputs() throws NodeException {
final boolean weIn = this.weIn.getBool();
cs = csIn.getBool();
if (cs) {
addr = (int) addrIn.getValue();
oe = oeIn.getBool();
if (weIn.getBool()) {
if (weIn && !lastweIn) {
long data = dataIn.getValue();
memory.setData(addr, data);
}
}
lastweIn=weIn;
}
@Override

View File

@ -48,6 +48,7 @@ public class RAMShape extends GenericShape {
dataBits = attr.get(Keys.BITS);
addrBits = attr.get(Keys.ADDR_BITS);
size = 1 << addrBits;
setInverterConfig(attr.get(Keys.INVERTER_CONFIG));
}
@Override