input [71:0] B1DATA;
input [7:0] B1EN;
- wire [15:0] A1ADDR_16 = A1ADDR;
- wire [15:0] B1ADDR_16 = B1ADDR;
+ wire [15:0] A1ADDR_16 = {A1ADDR, 6'b0};
+ wire [15:0] B1ADDR_16 = {B1ADDR, 6'b0};
wire [7:0] DIP, DOP;
wire [63:0] DI, DO;
echo "xvlog --work gold bram1_tb.v bram1.v > gold.txt"
echo "xvlog --work gate bram1_tb.v synth.v > gate.txt"
echo "xelab -R gold.bram1_tb >> gold.txt"
- echo "mv testbench.vcd gold.vcd"
+ # echo "mv testbench.vcd gold.vcd"
echo "xelab -L unisim -R gate.bram1_tb >> gate.txt"
- echo "mv testbench.vcd gate.vcd"
+ # echo "mv testbench.vcd gate.vcd"
echo "../bram1_cmp <( grep '#OUT#' gold.txt; ) <( grep '#OUT#' gate.txt; )"
} > bram1_$id/run.sh
{
reg [DBITS-1:0] memory [0:2**ABITS-1];
reg [DBITS-1:0] expected_rd;
+ event error;
+ reg error_ind = 0;
+
integer i, j;
initial begin
- $dumpfile("testbench.vcd");
- $dumpvars(0, bram1_tb);
+ // $dumpfile("testbench.vcd");
+ // $dumpvars(0, bram1_tb);
clk <= 0;
for (i = 0; i < 256; i = i+1) begin
WR_DATA <= i;
end
$display("#OUT# | WA=%x WD=%x WE=%x | RA=%x RD=%x | %s", WR_ADDR, WR_DATA, WR_EN, RD_ADDR, RD_DATA, expected_rd === RD_DATA ? "ok" : "ERROR");
+ if (expected_rd !== RD_DATA) begin -> error; error_ind = ~error_ind; end
end
end
endmodule