Renamed stdcells_sim.v to simcells.v and fixed blackbox.v

This commit is contained in:
Clifford Wolf 2013-11-24 20:44:00 +01:00
parent 8dafecd34d
commit 1afe6589df
6 changed files with 25 additions and 22 deletions

View File

@ -1,13 +1,21 @@
EXTRA_TARGETS += techlibs/common/blackbox.v EXTRA_TARGETS += techlibs/common/blackbox.v
techlibs/common/blackbox.v: techlibs/common/blackbox.sed techlibs/common/simlib.v techlibs/common/stdcells_sim.v techlibs/common/blackbox.v: techlibs/common/blackbox.sed techlibs/common/simlib.v techlibs/common/simcells.v
cat techlibs/common/simlib.v techlibs/common/stdcells_sim.v | sed -rf techlibs/common/blackbox.sed > techlibs/common/blackbox.v.new cat techlibs/common/simlib.v techlibs/common/simcells.v | sed -rf techlibs/common/blackbox.sed > techlibs/common/blackbox.v.new
mv techlibs/common/blackbox.v.new techlibs/common/blackbox.v mv techlibs/common/blackbox.v.new techlibs/common/blackbox.v
EXTRA_TARGETS += share/simlib.v EXTRA_TARGETS += share/simlib.v share/simcells.v share/blackbox.v
share/simlib.v: techlibs/common/simlib.v share/simlib.v: techlibs/common/simlib.v
mkdir -p share mkdir -p share
cp techlibs/common/simlib.v share/simlib.v cp techlibs/common/simlib.v share/simlib.v
share/simcells.v: techlibs/common/simcells.v
mkdir -p share
cp techlibs/common/simcells.v share/simcells.v
share/blackbox.v: techlibs/common/blackbox.v
mkdir -p share
cp techlibs/common/blackbox.v share/blackbox.v

View File

@ -1,4 +1,4 @@
#!/bin/sed -r #!/bin/sed -r
/^(wire|assign|reg)/ d; /^(wire|assign|reg|event)/ d;
/^(genvar|always|initial)/,/^end/ d; /^(genvar|generate|always|initial)/,/^end/ d;
s/ reg / /; s/ reg / /;

View File

@ -51,13 +51,8 @@ endmodule
module \$_MUX_ (A, B, S, Y); module \$_MUX_ (A, B, S, Y);
input A, B, S; input A, B, S;
output reg Y; output Y;
always @* begin assign Y = S ? B : A;
if (S)
Y = B;
else
Y = A;
end
endmodule endmodule
module \$_SR_NN_ (S, R, Q); module \$_SR_NN_ (S, R, Q);

View File

@ -31,13 +31,11 @@
* *
*/ */
`define INPUT_A \ `define INPUT_A input [A_WIDTH-1:0] A; \
input [A_WIDTH-1:0] A; \ generate if (A_SIGNED) begin:A_BUF wire signed [A_WIDTH-1:0] val = A; end else begin:A_BUF wire [A_WIDTH-1:0] val = A; end endgenerate
generate if (A_SIGNED) begin:A_BUF wire signed [A_WIDTH-1:0] val = A; end else begin:A_BUF wire [A_WIDTH-1:0] val = A; end endgenerate
`define INPUT_B \ `define INPUT_B input [B_WIDTH-1:0] B; \
input [B_WIDTH-1:0] B; \ generate if (B_SIGNED) begin:B_BUF wire signed [B_WIDTH-1:0] val = B; end else begin:B_BUF wire [B_WIDTH-1:0] val = B; end endgenerate
generate if (B_SIGNED) begin:B_BUF wire signed [B_WIDTH-1:0] val = B; end else begin:B_BUF wire [B_WIDTH-1:0] val = B; end endgenerate
// -------------------------------------------------------- // --------------------------------------------------------
@ -661,7 +659,7 @@ generate
end end
endgenerate endgenerate
always @* always @* begin
casez ({I[WIDTH-1], lut0_out, lut1_out}) casez ({I[WIDTH-1], lut0_out, lut1_out})
3'b?11: O = 1'b1; 3'b?11: O = 1'b1;
3'b?00: O = 1'b0; 3'b?00: O = 1'b0;
@ -669,6 +667,7 @@ always @*
3'b1??: O = lut1_out; 3'b1??: O = lut1_out;
default: O = 1'bx; default: O = 1'bx;
endcase endcase
end
endmodule endmodule
@ -784,9 +783,10 @@ input EN;
input [WIDTH-1:0] D; input [WIDTH-1:0] D;
output reg [WIDTH-1:0] Q; output reg [WIDTH-1:0] Q;
always @* always @* begin
if (EN == EN_POLARITY) if (EN == EN_POLARITY)
Q <= D; Q <= D;
end
endmodule endmodule

View File

@ -28,7 +28,7 @@ EOT
vlogcomp --work syn i2c_master_syn.v vlogcomp --work syn i2c_master_syn.v
vlogcomp --work syn ../../techlibs/common/simlib.v vlogcomp --work syn ../../techlibs/common/simlib.v
vlogcomp --work syn ../../techlibs/common/stdcells_sim.v vlogcomp --work syn ../../techlibs/common/simcells.v
vlogcomp --work syn i2c_slave_model.v vlogcomp --work syn i2c_slave_model.v
vlogcomp --work syn spi_slave_model.v vlogcomp --work syn spi_slave_model.v
vlogcomp --work syn tst_bench_top.v vlogcomp --work syn tst_bench_top.v

View File

@ -139,7 +139,7 @@ do
compile_and_run ${bn}_tb_syn${test_count} ${bn}_out_syn${test_count} \ compile_and_run ${bn}_tb_syn${test_count} ${bn}_out_syn${test_count} \
${bn}_tb.v ${bn}_syn${test_count}.v $libs \ ${bn}_tb.v ${bn}_syn${test_count}.v $libs \
"$toolsdir"/../../techlibs/common/simlib.v \ "$toolsdir"/../../techlibs/common/simlib.v \
"$toolsdir"/../../techlibs/common/stdcells_sim.v "$toolsdir"/../../techlibs/common/simcells.v
if $genvcd; then mv testbench.vcd ${bn}_syn${test_count}.vcd; fi if $genvcd; then mv testbench.vcd ${bn}_syn${test_count}.vcd; fi
$toolsdir/cmp_tbdata ${bn}_out_ref ${bn}_out_syn${test_count} $toolsdir/cmp_tbdata ${bn}_out_ref ${bn}_out_syn${test_count}
test_count=$(( test_count + 1 )) test_count=$(( test_count + 1 ))