Closed mithro closed 6 years ago
Looking at the EDIF Vivado itself produces;
From the following Verilog;
(* ars_ff1 = "true", async_reg = "true" *) FDPE #(
.INIT(1'd1)
) FDPE (
.C(sys_clk),
.CE(1'd1),
.D(1'd0),
.PRE(xilinxasyncresetsynchronizerimpl0),
.Q(xilinxasyncresetsynchronizerimpl0_rst_meta)
);
(* ars_ff2 = "true", async_reg = "true" *) FDPE #(
.INIT(1'd1)
) FDPE_1 (
.C(sys_clk),
.CE(1'd1),
.D(xilinxasyncresetsynchronizerimpl0_rst_meta),
.PRE(xilinxasyncresetsynchronizerimpl0),
.Q(sys_rst)
);
(* ars_ff1 = "true", async_reg = "true" *) FDPE #(
.INIT(1'd1)
) FDPE_2 (
.C(clk200_clk),
.CE(1'd1),
.D(1'd0),
.PRE(xilinxasyncresetsynchronizerimpl1),
.Q(xilinxasyncresetsynchronizerimpl1_rst_meta)
);
(* ars_ff2 = "true", async_reg = "true" *) FDPE #(
.INIT(1'd1)
) FDPE_3 (
.C(clk200_clk),
.CE(1'd1),
.D(xilinxasyncresetsynchronizerimpl1_rst_meta),
.PRE(xilinxasyncresetsynchronizerimpl1),
.Q(clk200_rst)
);
You get the following EDIF;
(instance FDPE (viewref netlist (cellref FDPE (libraryref hdi_primitives)))
(property BOX_TYPE (string "PRIMITIVE"))
(property INIT (string "1'b1"))
(property IS_C_INVERTED (string "1'b0"))
(property IS_D_INVERTED (string "1'b0"))
(property IS_PRE_INVERTED (string "1'b0"))
(property ars_ff1 (string "true"))
(property ASYNC_REG (boolean (true)))
)
(instance FDPE_1 (viewref netlist (cellref FDPE (libraryref hdi_primitives)))
(property BOX_TYPE (string "PRIMITIVE"))
(property INIT (string "1'b1"))
(property IS_C_INVERTED (string "1'b0"))
(property IS_D_INVERTED (string "1'b0"))
(property IS_PRE_INVERTED (string "1'b0"))
(property ars_ff2 (string "true"))
(property ASYNC_REG (boolean (true)))
)
(instance FDPE_2 (viewref netlist (cellref FDPE (libraryref hdi_primitives)))
(property BOX_TYPE (string "PRIMITIVE"))
(property INIT (string "1'b1"))
(property IS_C_INVERTED (string "1'b0"))
(property IS_D_INVERTED (string "1'b0"))
(property IS_PRE_INVERTED (string "1'b0"))
(property ars_ff1 (string "true"))
(property ASYNC_REG (boolean (true)))
)
(instance FDPE_3 (viewref netlist (cellref FDPE (libraryref hdi_primitives)))
(property BOX_TYPE (string "PRIMITIVE"))
(property INIT (string "1'b1"))
(property IS_C_INVERTED (string "1'b0"))
(property IS_D_INVERTED (string "1'b0"))
(property IS_PRE_INVERTED (string "1'b0"))
(property ars_ff2 (string "true"))
(property ASYNC_REG (boolean (true)))
)
If seems as simple as adding the following output to the EDIF; (property ars_ff2 (string "true"))
or (property ars_ff1 (string "true"))
.
Yosys currently produces the following EDIF for the verilog;
(instance FDPE
(viewRef VIEW_NETLIST (cellRef FDPE (libraryRef LIB)))
(property INIT (integer 1)))
(instance FDPE_1
(viewRef VIEW_NETLIST (cellRef FDPE (libraryRef LIB)))
(property INIT (integer 1)))
(instance FDPE_2
(viewRef VIEW_NETLIST (cellRef FDPE (libraryRef LIB)))
(property INIT (integer 1)))
(instance FDPE_3
(viewRef VIEW_NETLIST (cellRef FDPE (libraryRef LIB)))
(property INIT (integer 1)))
Commit 115ca57 adds write_edif -attrprop
with this functionality.
Just confirming this seems to work!
hierarchy -top top
# proc; memory; opt; fsm; opt
attrmap -tocase keep -imap keep="true" keep=1 \
-imap keep="false" keep=0 -remove keep=0
synth_xilinx -top top
write_edif -attrprop top.edif
Vivado is now seeing the custom attributes and the xdc constraints seem to be successfully applied to them!
Steps to reproduce the issue
When creating code in migen for use with Vivado, the code is generated with custom attributes and then constraints applied in the XDC output.
The created Verilog code looks likes the following;
You then use XDC to apply constraints like the following;
When using the following Yosys script;
and this Vivado script
The Verilog attributes don't seem to end up in the EDIF file and Vivado outputs the following issues;
A full example found here.
Expected behavior
This works in Vivado and it would be nice for it to work when using Yosys as a replacement synthesis tool.
FYI The custom properties that migen uses are the follow;