mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-19 01:44:44 -04:00
fixed a Bug in the RAMSinglePortSel component: Write was not edge-triggered on WE. Now it is.
This commit is contained in:
parent
85283db343
commit
a7811c3e38
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user