Merge pull request #2 from tony-min-1/move_tests

Move tests
This commit is contained in:
Tony Min 2024-07-04 16:05:04 -04:00 committed by GitHub
commit e9ff5f7d91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
47 changed files with 74 additions and 63 deletions

View File

@ -863,6 +863,7 @@ endif
+cd tests/arch/quicklogic/pp3 && bash run-test.sh $(SEEDOPT) +cd tests/arch/quicklogic/pp3 && bash run-test.sh $(SEEDOPT)
+cd tests/arch/quicklogic/qlf_k6n10f && bash run-test.sh $(SEEDOPT) +cd tests/arch/quicklogic/qlf_k6n10f && bash run-test.sh $(SEEDOPT)
+cd tests/arch/gatemate && bash run-test.sh $(SEEDOPT) +cd tests/arch/gatemate && bash run-test.sh $(SEEDOPT)
+cd tests/arch/microchip && bash run-test.sh $(SEEDOPT)
+cd tests/rpc && bash run-test.sh +cd tests/rpc && bash run-test.sh
+cd tests/memfile && bash run-test.sh +cd tests/memfile && bash run-test.sh
+cd tests/verilog && bash run-test.sh +cd tests/verilog && bash run-test.sh

View File

@ -31,9 +31,9 @@ endmodule
(* techmap_celltype = "$reduce_xor" *) (* techmap_celltype = "$reduce_xor" *)
module \$__microchip_XOR8_ (A, Y); module \$__microchip_XOR8_ (A, Y);
parameter A_SIGNED = 0; parameter A_SIGNED = 1;
parameter A_WIDTH = 0; parameter A_WIDTH = 8;
parameter Y_WIDTH = 0; parameter Y_WIDTH = 1;
input [A_WIDTH-1:0] A; input [A_WIDTH-1:0] A;
output [Y_WIDTH-1:0] Y; output [Y_WIDTH-1:0] Y;

View File

@ -164,22 +164,18 @@ module MICROCHIP_SYNC_SET_DFF(
input CLK, input CLK,
input Set, input Set,
input En, input En,
output Q); output reg Q);
parameter [0:0] INIT = 1'b0; // unused parameter [0:0] INIT = 1'b0; // unused
reg q_ff;
always @(posedge CLK) begin always @(posedge CLK) begin
if (En == 1) begin if (En == 1) begin
if (Set == 0) if (Set == 0)
q_ff <= 1; Q <= 1;
else else
q_ff <= D; Q <= D;
end end
end end
assign Q = q_ff;
specify specify
$setup(D , posedge CLK &&& En && Set, 0); // neg setup not supported? $setup(D , posedge CLK &&& En && Set, 0); // neg setup not supported?
$setup(En, posedge CLK, 109); $setup(En, posedge CLK, 109);
@ -195,22 +191,18 @@ module MICROCHIP_SYNC_RESET_DFF(
input CLK, input CLK,
input Reset, input Reset,
input En, input En,
output Q); output reg Q);
parameter [0:0] INIT = 1'b0; // unused parameter [0:0] INIT = 1'b0; // unused
reg q_ff;
always @(posedge CLK) begin always @(posedge CLK) begin
if (En == 1) begin if (En == 1) begin
if (Reset == 0) if (Reset == 0)
q_ff <= 0; Q <= 0;
else else
q_ff <= D; Q <= D;
end end
end end
assign Q = q_ff;
specify specify
$setup(D , posedge CLK &&& En && Reset, 0); // neg setup not supported? $setup(D , posedge CLK &&& En && Reset, 0); // neg setup not supported?
$setup(En, posedge CLK, 109); $setup(En, posedge CLK, 109);

4
tests/arch/microchip/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
*.log
/run-test.mk
*.vm

View File

@ -21,7 +21,7 @@ module Registers(
input en, input en,
input rst, input rst,
input D, input D,
output Q output reg Q
); );
parameter LOAD_DATA = 1; parameter LOAD_DATA = 1;

View File

@ -19,5 +19,6 @@ read_verilog Registers.v
synth_microchip -top Registers -abc9 -family polarfire -noiopad synth_microchip -top Registers -abc9 -family polarfire -noiopad
# write final outputfile select -assert-count 1 t:SLE
write_verilog -noexpr Registers.vm select -assert-count 1 t:CLKBUF
select -assert-none t:SLE t:CLKBUF %% t:* %D

View File

@ -18,4 +18,5 @@ read_verilog carryout.v
synth_microchip -top carryout -abc9 -family polarfire -noiopad synth_microchip -top carryout -abc9 -family polarfire -noiopad
write_verilog -noexpr carryout.vm select -assert-count 1 t:MACC_PA
select -assert-none t:MACC_PA %% t:* %D

View File

@ -18,4 +18,5 @@ read_verilog cascade.v
synth_microchip -top cascade -abc9 -family polarfire -noiopad synth_microchip -top cascade -abc9 -family polarfire -noiopad
write_verilog -noexpr cascade.vm select -assert-count 2 t:MACC_PA
select -assert-none t:MACC_PA %% t:* %D

View File

@ -13,9 +13,12 @@
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
read_verilog dff_opt.v read_verilog dff_opt.v
synth_microchip -top dff_opt -abc9 -family polarfire -noiopad synth_microchip -top dff_opt -abc9 -family polarfire -noiopad
# write final outputfile select -assert-count 1 t:SLE
write_verilog -noexpr dff_opt.vm select -assert-count 1 t:CFG4
select -assert-count 1 t:CLKBUF
select -assert-none t:SLE t:CFG4 t:CLKBUF %% t:* %D

View File

@ -18,4 +18,5 @@ read_verilog full_dsp.v
synth_microchip -top full_dsp -abc9 -family polarfire -noiopad synth_microchip -top full_dsp -abc9 -family polarfire -noiopad
write_verilog -noexpr full_dsp.vm select -assert-count 1 t:MACC_PA
select -assert-none t:MACC_PA %% t:* %D

View File

@ -18,4 +18,6 @@ read_verilog large_mult.v
synth_microchip -top large_mult -abc9 -family polarfire -noiopad synth_microchip -top large_mult -abc9 -family polarfire -noiopad
write_verilog -noexpr large_mult.vm select -assert-count 2 t:MACC_PA
select -assert-none t:MACC_PA %% t:* %D

View File

@ -20,5 +20,5 @@ read_verilog mac.v
# run the synth flow, specifies top module and additional parameters # run the synth flow, specifies top module and additional parameters
synth_microchip -top mac -abc9 -family polarfire -noiopad synth_microchip -top mac -abc9 -family polarfire -noiopad
# write final outputfile select -assert-count 1 t:MACC_PA
write_verilog -noexpr mac.vm select -assert-none t:MACC_PA %% t:* %D

View File

@ -18,4 +18,5 @@ read_verilog postAdd_mult.v
synth_microchip -top postAdd_mult -abc9 -family polarfire -noiopad synth_microchip -top postAdd_mult -abc9 -family polarfire -noiopad
write_verilog -noexpr postAdd_mult.vm select -assert-count 1 t:MACC_PA
select -assert-none t:MACC_PA %% t:* %D

View File

@ -16,6 +16,8 @@
read_verilog post_adder.v read_verilog post_adder.v
synth_microchip -top post_adder -abc9 -family polarfire synth_microchip -top post_adder -abc9 -family polarfire -noiopad
select -assert-count 1 t:MACC_PA
select -assert-none t:MACC_PA %% t:* %D
write_verilog -noexpr post_adder.vm

View File

@ -18,4 +18,5 @@ read_verilog pre_adder_dsp.v
synth_microchip -top pre_adder_dsp -abc9 -family polarfire -noiopad synth_microchip -top pre_adder_dsp -abc9 -family polarfire -noiopad
write_verilog -noexpr pre_adder_dsp.vm select -assert-count 1 t:MACC_PA
select -assert-none t:MACC_PA %% t:* %D

View File

@ -18,4 +18,7 @@ read_verilog ram_SDP.v
synth_microchip -top ram_SDP -abc9 -family polarfire -noiopad synth_microchip -top ram_SDP -abc9 -family polarfire -noiopad
write_verilog -noexpr ram_SDP.vm select -assert-count 1 t:RAM1K20
select -assert-count 1 t:CFG1
select -assert-none t:RAM1K20 t:CFG1 %% t:* %D

View File

@ -18,4 +18,5 @@ read_verilog ram_TDP.v
synth_microchip -top ram_TDP -abc9 -family polarfire -noiopad -debug_memory synth_microchip -top ram_TDP -abc9 -family polarfire -noiopad -debug_memory
write_verilog -noexpr ram_TDP.vm select -assert-count 1 t:RAM1K20
select -assert-none t:RAM1K20 %% t:* %D

View File

@ -18,4 +18,6 @@ read_verilog reduce.v
synth_microchip -top reduce -abc9 -family polarfire -noiopad synth_microchip -top reduce -abc9 -family polarfire -noiopad
write_verilog -noexpr reduce.vm select -assert-count 1 t:XOR8
select -assert-none t:XOR8 %% t:* %D

View File

@ -18,4 +18,5 @@ read_verilog reg_c.v
synth_microchip -top reg_c -abc9 -family polarfire -noiopad synth_microchip -top reg_c -abc9 -family polarfire -noiopad
write_verilog -noexpr reg_c.vm select -assert-count 1 t:MACC_PA
select -assert-none t:MACC_PA %% t:* %D

View File

@ -18,4 +18,5 @@ read_verilog reg_test.v
synth_microchip -top reg_test -abc9 -family polarfire -noiopad synth_microchip -top reg_test -abc9 -family polarfire -noiopad
write_verilog -noexpr reg_test.vm select -assert-count 1 t:MACC_PA
select -assert-none t:MACC_PA %% t:* %D

View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -eu
source ../../gen-tests-makefile.sh
run_tests --yosys-scripts --bash --yosys-args "-w 'Yosys has only limited support for tri-state logic at the moment.'"

View File

@ -18,4 +18,5 @@ read_verilog signed_mult.v
synth_microchip -top signed_mult -abc9 -family polarfire -noiopad synth_microchip -top signed_mult -abc9 -family polarfire -noiopad
write_verilog -noexpr signed_mult.vm select -assert-count 1 t:MACC_PA
select -assert-none t:MACC_PA %% t:* %D

View File

@ -18,4 +18,5 @@ read_verilog simple_ram.v
synth_microchip -top simple_ram -abc9 -family polarfire -noiopad synth_microchip -top simple_ram -abc9 -family polarfire -noiopad
write_verilog -noexpr simple_ram.vm select -assert-count 1 t:RAM1K20
select -assert-none t:RAM1K20 %% t:* %D

View File

@ -18,4 +18,5 @@ read_verilog unsigned_mult.v
synth_microchip -top unsigned_mult -abc9 -family polarfire -noiopad synth_microchip -top unsigned_mult -abc9 -family polarfire -noiopad
write_verilog -noexpr unsigned_mult.vm select -assert-count 1 t:MACC_PA
select -assert-none t:MACC_PA %% t:* %D

View File

@ -17,9 +17,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
module uram_ar(data,waddr,we,clk,q); module uram_ar(data,waddr,we,clk,q);
parameter d_width = 27; parameter d_width = 12;
parameter addr_width = 2; parameter addr_width = 2;
parameter mem_depth = 4; parameter mem_depth = 12;
input [d_width-1:0] data; input [d_width-1:0] data;
input [addr_width-1:0] waddr; input [addr_width-1:0] waddr;
input we, clk; input we, clk;

View File

@ -18,4 +18,5 @@ read_verilog uram_ar.v
synth_microchip -top uram_ar -abc9 -family polarfire -noiopad synth_microchip -top uram_ar -abc9 -family polarfire -noiopad
write_verilog -noexpr uram_ar.vm select -assert-count 1 t:RAM64x12
select -assert-none t:RAM64x12 %% t:* %D

View File

@ -18,4 +18,5 @@ read_verilog uram_sr.v
synth_microchip -top uram_sr -abc9 -family polarfire -noiopad synth_microchip -top uram_sr -abc9 -family polarfire -noiopad
write_verilog -noexpr uram_sr.vm select -assert-count 1 t:RAM64x12
select -assert-none t:RAM64x12 %% t:* %D

View File

@ -23,25 +23,8 @@ module widemux(
output Y output Y
); );
assign Y = S1 ? (S0 ? data[3] : data[1]) : (S0 ? data[2] : data[0]);
wire A, B;
always @ (*) begin
if (S0)begin
A = data[1];
B = data[3];
end else begin
A = data[0];
B = data[2];
end
if (S1)begin
Y = A;
end else begin
Y = B;
end
end
endmodule endmodule

View File

@ -18,4 +18,5 @@ read_verilog widemux.v
synth_microchip -top widemux -abc9 -family polarfire -noiopad synth_microchip -top widemux -abc9 -family polarfire -noiopad
write_verilog -noexpr widemux.vm select -assert-count 1 t:MX4
select -assert-none t:MX4 %% t:* %D