Skip to content

Commit

Permalink
Fix synchronous read bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tilk committed May 8, 2024
1 parent a541f0f commit 199b946
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "digitaljs",
"version": "0.13.0",
"version": "0.13.1",
"description": "Digital logic simulator",
"main": "./lib/circuit.js",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions src/cells/memory.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ export const Memory = Box.define('Memory', {
for (const [num, wrport] of this.get('wrports').entries()) {
const wrportname = 'wr' + num;
const mask_ok = (val, num) => typeof val == 'boolean' ? val : val[num];
if ('transparent' in port && mask_ok(port.transparent, num) && port_active(wrportname, wrport) && data[portname + 'addr'] == data[wrportname + 'addr'])
if ('transparent' in port && mask_ok(port.transparent, num) && port_active(wrportname, wrport) && is_enabled(wrportname, wrport) && data[portname + 'addr'] == data[wrportname + 'addr'])
out[portname + 'data'] = write_value(wrportname, wrport, out[portname + 'data'], data[wrportname + 'data']);
if ('collision' in port && mask_ok(port.collision, num) && port_active(wrportname, wrport) && data[portname + 'addr'] == data[wrportname + 'addr'])
if ('collision' in port && mask_ok(port.collision, num) && port_active(wrportname, wrport) && is_enabled(wrportname, wrport) && data[portname + 'addr'] == data[wrportname + 'addr'])
out[portname + 'data'] = write_value(wrportname, wrport, out[portname + 'data'], Vector3vl.xes(bits));
}

Expand Down

0 comments on commit 199b946

Please sign in to comment.