+cd tests/fsm && bash run-test.sh
+cd tests/techmap && bash run-test.sh
+cd tests/memories && bash run-test.sh
+ +cd tests/bram && bash run-test.sh
+cd tests/various && bash run-test.sh
+cd tests/sat && bash run-test.sh
@echo ""
SigBit last_en_bit = State::S1;
for (int i = 0; i < mem_width; i++) {
if (pi.enable && i % (bram.dbits / pi.enable) == 0) {
- last_en_bit = wr_en[i];
+ last_en_bit = wr_en[i + cell_port_i*mem_width];
sig_en.append(last_en_bit);
}
- if (last_en_bit != wr_en[i]) {
+ if (last_en_bit != wr_en[i + cell_port_i*mem_width]) {
log(" Bram port %c%d has incompatible enable structure.\n", pi.group + 'A', pi.index + 1);
goto skip_bram_wport;
}
pi.sig_addr = wr_addr.extract(cell_port_i*mem_abits, mem_abits);
pi.sig_data = wr_data.extract(cell_port_i*mem_width, mem_width);
+ bram_port_i++;
goto mapped_wr_port;
}
int grow_read_ports_cursor = -1;
bool try_growing_more_read_ports = false;
+ auto backup_clock_domains = clock_domains;
if (0) {
grow_read_ports:;
}
try_growing_more_read_ports = false;
portinfos.swap(new_portinfos);
+ clock_domains = backup_clock_domains;
dup_count++;
}
string prefix = stringf("%c%d", pi.group + 'A', pi.index + 1);
const char *pf = prefix.c_str();
- if (pi.clocks)
+ if (pi.clocks && (!clocks.count(pi.clocks) || pi.sig_clock.wire))
clocks[pi.clocks] = pi.sig_clock;
SigSpec addr_ok;
dbits = random.randrange(1, 8)
groups = random.randrange(1, 5)
- # XXX
- init = 0
- groups = 2
-
if random.randrange(2):
abits = 2 ** random.randrange(1, 4)
if random.randrange(2):
clkpol = [ random.randrange(4) for i in range(groups) ]
# XXX
- ports = [ 1 for i in range(groups) ]
- wrmode = [ 1 for i in range(groups) ]
+ init = 0
transp = [ 0 for i in range(groups) ]
clocks = [ 1 for i in range(groups) ]
clkpol = [ 1 for i in range(groups) ]
- wrmode[0] = 0
for p1 in range(groups):
if wrmode[p1] == 0:
if debug_mode:
print(" $dumpfile(`vcd_file);", file=tb_f)
- print(" $dumpvars(2, bram_%02d_%02d_tb);" % (k1, k2), file=tb_f)
+ print(" $dumpvars(0, bram_%02d_%02d_tb);" % (k1, k2), file=tb_f)
for p in (tb_clocks + tb_addr + tb_din):
if p[-2:] == "EN":
if len(tb_clocks):
c = random.choice(tb_clocks)
print(" %s = !%s;" % (c, c), file=tb_f)
+ print(" #100;", file=tb_f)
+ print(" $display(\"bram_%02d_%02d %3d: %%b %%b %%s\", %s, %s, error ? \"ERROR\" : \"OK\");" %
+ (k1, k2, i, expr_dout, expr_dout_ref), file=tb_f)
for p in tb_din:
print(" %s <= %d;" % (p, random.randrange(1048576)), file=tb_f)
for p in tb_addr:
print(" %s <= %d;" % (p, random.choice(tb_addrlist)), file=tb_f)
- print(" #1000;", file=tb_f)
- print(" $display(\"bram_%02d_%02d %3d: %%b %%b %%s\", %s, %s, error ? \"ERROR\" : \"OK\");" %
- (k1, k2, i, expr_dout, expr_dout_ref), file=tb_f)
+ print(" #900;", file=tb_f)
print(" end", file=tb_f)
print("endmodule", file=tb_f)
iverilog -Dvcd_file=\"temp/tb_${1}_${2}.vcd\" -o temp/tb_${1}_${2}.tb temp/brams_${1}_tb.v temp/brams_${1}_ref.v \
temp/synth_${1}_${2}.v temp/brams_${2}.v ../../techlibs/common/simlib.v
temp/tb_${1}_${2}.tb > temp/tb_${1}_${2}.txt
-if grep -H -C1 ERROR temp/tb_${1}_${2}.txt; then exit 1; fi
+if grep -q ERROR temp/tb_${1}_${2}.txt; then
+ grep -HC2 ERROR temp/tb_${1}_${2}.txt | head
+ exit 1
+fi
exit 0
for j in $( ls temp/brams_*.txt | sed 's,.*_,,; s,\..*,,;' | grep -v $i ); do
echo "temp/job_${i}_${j}.ok:"
echo " @bash run-single.sh ${i} ${j}"
- echo " @echo 'Passed test ${i}_${j}.'"
+ echo " @echo 'Passed memory_bram test ${i}_${j}.'"
echo " @touch \$@"
done; done
} > temp/makefile