mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-16 00:15:01 -04:00
Fixed a problem with the generated verilog code for the ROM component
This commit is contained in:
parent
9af27c79cd
commit
922a09eef7
@ -32,7 +32,6 @@ public class VerilogTemplate implements VerilogElement {
|
|||||||
private final static String MODULE_PREFIX = "DIG_";
|
private final static String MODULE_PREFIX = "DIG_";
|
||||||
|
|
||||||
private final String moduleBaseName;
|
private final String moduleBaseName;
|
||||||
private String moduleName;
|
|
||||||
private final Statement statements;
|
private final Statement statements;
|
||||||
private HashMap<String, Module> modules;
|
private HashMap<String, Module> modules;
|
||||||
|
|
||||||
|
@ -8,12 +8,11 @@
|
|||||||
?>module <?= moduleName ?> (
|
?>module <?= moduleName ?> (
|
||||||
input <?= aBitRange ?> A,
|
input <?= aBitRange ?> A,
|
||||||
input sel,
|
input sel,
|
||||||
output <?= dBitRange ?> D
|
output reg <?= dBitRange ?> D
|
||||||
);
|
);
|
||||||
reg <?= dBitRange ?> my_rom [0:<?= (romSize - 1) ?>];
|
reg <?= dBitRange ?> my_rom [0:<?= (romSize - 1) ?>];
|
||||||
reg D;
|
|
||||||
|
|
||||||
always @ (A or sel) begin
|
always @ (*) begin
|
||||||
if (~sel)
|
if (~sel)
|
||||||
D = <?= elem.Bits ?>'hz;<?
|
D = <?= elem.Bits ?>'hz;<?
|
||||||
if (romSize < romMaxSize) {
|
if (romSize < romMaxSize) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user