ice40: Debugging and fixing FF configuration

Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
David Shah 2018-06-12 14:27:04 +02:00
parent 9ee6a6e114
commit 95fb0595a5
4 changed files with 19 additions and 11 deletions

View File

@ -99,16 +99,18 @@ void dff_to_lc(CellInfo *dff, CellInfo *lc, bool pass_thru_lut)
if (citer != config.end()) { if (citer != config.end()) {
if ((config.end() - citer) >= 2) { if ((config.end() - citer) >= 2) {
assert(*(citer++) == 'S'); assert(*(citer++) == 'S');
lc->params["ASYNC_SR"] = "1";
} else {
lc->params["ASYNC_SR"] = "0"; lc->params["ASYNC_SR"] = "0";
} else {
lc->params["ASYNC_SR"] = "1";
} }
if (*citer == 'S') { if (*citer == 'S') {
citer++;
replace_port(dff, "S", lc, "SR"); replace_port(dff, "S", lc, "SR");
lc->params["SET_NORESET"] = "1"; lc->params["SET_NORESET"] = "1";
} else { } else {
assert(*citer == 'R'); assert(*citer == 'R');
citer++;
replace_port(dff, "R", lc, "SR"); replace_port(dff, "R", lc, "SR");
lc->params["SET_NORESET"] = "0"; lc->params["SET_NORESET"] = "0";
} }

2
ice40/pack_tests/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.vcd
*_out.v

View File

@ -1,6 +1,10 @@
module top(input clk, cen, rst, ina, inb, output reg outa, outb, outc, outd); module top(input clk, cen, rst, ina, inb, output reg outa, outb, outc, outd);
reg temp0 = 1'b0, temp1 = 1'b0; reg temp0 = 1'b0, temp1 = 1'b0;
initial outa = 1'b0;
initial outb = 1'b0;
initial outc = 1'b0;
initial outd = 1'b0;
always @(posedge clk) always @(posedge clk)
if (cen) if (cen)
@ -17,8 +21,8 @@ always @(negedge clk)
temp1 <= inb; temp1 <= inb;
always @(posedge clk or negedge rst) always @(posedge clk or posedge rst)
if(!rst) if(rst)
outa <= 1'b0; outa <= 1'b0;
else else
outa <= temp0; outa <= temp0;

View File

@ -5,11 +5,11 @@ yosys -p "synth_ice40 -nocarry -top io_wrapper; write_json ${NAME}.json" $1 io_w
../../nextpnr-ice40 --json ${NAME}.json --pack --asc ${NAME}.asc ../../nextpnr-ice40 --json ${NAME}.json --pack --asc ${NAME}.asc
icebox_vlog -p test.pcf ${NAME}.asc > ${NAME}_out.v icebox_vlog -p test.pcf ${NAME}.asc > ${NAME}_out.v
yosys -p "rename top gate\ yosys -p "rename chip gate;\
read_verilog $1\ read_verilog $1;\
rename top gold\ rename top gold;\
hierarchy\ hierarchy;\
proc\ proc;\
clk2fflogic\ clk2fflogic;\
miter -equiv -flatten -ignore_gold_x -make_outputs -make_outcmp gold gate miter\ miter -equiv -flatten -ignore_gold_x -make_outputs -make_outcmp gold gate miter;\
sat -dump_vcd equiv_${NAME}.vcd -verify-no-timeout -timeout 20 -seq 10 -prove trigger 0 -prove-skip 1 -show-inputs -show-outputs miter" ${NAME}_out.v sat -dump_vcd equiv_${NAME}.vcd -verify-no-timeout -timeout 20 -seq 10 -prove trigger 0 -prove-skip 1 -show-inputs -show-outputs miter" ${NAME}_out.v