mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-25 12:36:02 +00:00
Progress in presentation
This commit is contained in:
parent
1c85584fe5
commit
b18fa95d2f
9 changed files with 188 additions and 23 deletions
|
@ -1,8 +1,16 @@
|
|||
|
||||
all: scrambler_p01.pdf scrambler_p02.pdf
|
||||
all: scrambler_p01.pdf scrambler_p02.pdf equiv.log axis_test.log
|
||||
|
||||
scrambler_p01.pdf: scrambler.ys scrambler.v
|
||||
../../yosys scrambler.ys
|
||||
|
||||
scrambler_p02.pdf: scrambler_p01.pdf
|
||||
|
||||
equiv.log: equiv.ys
|
||||
../../yosys -l equiv.log_new equiv.ys
|
||||
mv equiv.log_new equiv.log
|
||||
|
||||
axis_test.log: axis_test.ys axis_master.v axis_test.v
|
||||
../../yosys -l axis_test.log_new axis_test.ys
|
||||
mv axis_test.log_new axis_test.log
|
||||
|
||||
|
|
27
manual/PRESENTATION_ExOth/axis_master.v
Normal file
27
manual/PRESENTATION_ExOth/axis_master.v
Normal file
|
@ -0,0 +1,27 @@
|
|||
module axis_master(aclk, aresetn, tvalid, tready, tdata);
|
||||
input aclk, aresetn, tready;
|
||||
output reg tvalid;
|
||||
output reg [7:0] tdata;
|
||||
|
||||
reg [31:0] state;
|
||||
always @(posedge aclk) begin
|
||||
if (!aresetn) begin
|
||||
state <= 314159265;
|
||||
tvalid <= 0;
|
||||
tdata <= 'bx;
|
||||
end else begin
|
||||
if (tvalid && tready)
|
||||
tvalid <= 0;
|
||||
if (!tvalid || !tready) begin
|
||||
// ^- should be not inverted!
|
||||
state = state ^ state << 13;
|
||||
state = state ^ state >> 7;
|
||||
state = state ^ state << 17;
|
||||
if (state[9:8] == 0) begin
|
||||
tvalid <= 1;
|
||||
tdata <= state;
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
endmodule
|
27
manual/PRESENTATION_ExOth/axis_test.v
Normal file
27
manual/PRESENTATION_ExOth/axis_test.v
Normal file
|
@ -0,0 +1,27 @@
|
|||
module axis_test(aclk, tready);
|
||||
input aclk, tready;
|
||||
wire aresetn, tvalid;
|
||||
wire [7:0] tdata;
|
||||
|
||||
integer counter = 0;
|
||||
reg aresetn = 0;
|
||||
|
||||
axis_master uut (aclk, aresetn, tvalid, tready, tdata);
|
||||
|
||||
always @(posedge aclk) begin
|
||||
if (aresetn && tready && tvalid) begin
|
||||
if (counter == 0) assert(tdata == 19);
|
||||
if (counter == 1) assert(tdata == 99);
|
||||
if (counter == 2) assert(tdata == 1);
|
||||
if (counter == 3) assert(tdata == 244);
|
||||
if (counter == 4) assert(tdata == 133);
|
||||
if (counter == 5) assert(tdata == 209);
|
||||
if (counter == 6) assert(tdata == 241);
|
||||
if (counter == 7) assert(tdata == 137);
|
||||
if (counter == 8) assert(tdata == 176);
|
||||
if (counter == 9) assert(tdata == 6);
|
||||
counter <= counter + 1;
|
||||
end
|
||||
aresetn <= 1;
|
||||
end
|
||||
endmodule
|
5
manual/PRESENTATION_ExOth/axis_test.ys
Normal file
5
manual/PRESENTATION_ExOth/axis_test.ys
Normal file
|
@ -0,0 +1,5 @@
|
|||
read_verilog -sv axis_master.v axis_test.v
|
||||
hierarchy -top axis_test
|
||||
|
||||
proc; flatten;;
|
||||
sat -falsify -seq 50 -prove-asserts
|
17
manual/PRESENTATION_ExOth/equiv.ys
Normal file
17
manual/PRESENTATION_ExOth/equiv.ys
Normal file
|
@ -0,0 +1,17 @@
|
|||
# read test design
|
||||
read_verilog ../PRESENTATION_ExSyn/techmap_01.v
|
||||
hierarchy -top test
|
||||
|
||||
# create two version of the design: test_orig and test_mapped
|
||||
copy test test_orig
|
||||
rename test test_mapped
|
||||
|
||||
# apply the techmap only to test_mapped
|
||||
techmap -map ../PRESENTATION_ExSyn/techmap_01_map.v test_mapped
|
||||
|
||||
# create a miter circuit to test equivialence
|
||||
miter -equiv -make_assert -make_outputs test_orig test_mapped miter
|
||||
flatten miter
|
||||
|
||||
# run equivialence check
|
||||
sat -verify -prove-asserts -show-inputs -show-outputs miter
|
Loading…
Add table
Add a link
Reference in a new issue