diff --git a/changelog/2024-10-26T14_40_52+02_00_fix_oddr b/changelog/2024-10-26T14_40_52+02_00_fix_oddr new file mode 100644 index 0000000000..a4d1a52d23 --- /dev/null +++ b/changelog/2024-10-26T14_40_52+02_00_fix_oddr @@ -0,0 +1 @@ +FIXED: `oddr` in `Clash.Xilinx.DDR`: Fixed HDL generation erroring out for VHDL and SystemVerilog diff --git a/clash-lib/prims/systemverilog/Clash_Xilinx_DDR.primitives.yaml b/clash-lib/prims/systemverilog/Clash_Xilinx_DDR.primitives.yaml index 008f46666a..c297f0b18d 100644 --- a/clash-lib/prims/systemverilog/Clash_Xilinx_DDR.primitives.yaml +++ b/clash-lib/prims/systemverilog/Clash_Xilinx_DDR.primitives.yaml @@ -70,7 +70,7 @@ ODDR #( .DDR_CLK_EDGE("SAME_EDGE"), .INIT(1'b0), - .SRTYPE(~IF ~ISSYNC[2] ~THEN "SYNC" ~ELSE "ASYNC" ~FI) + .SRTYPE(~IF ~ISSYNC[1] ~THEN "SYNC" ~ELSE "ASYNC" ~FI) ) ~GENSYM[~COMPNAME_ODDR][9] ( .Q(~SYM[3][~SYM[8]]), .C(~ARG[3]), diff --git a/clash-lib/prims/vhdl/Clash_Xilinx_DDR.primitives.yaml b/clash-lib/prims/vhdl/Clash_Xilinx_DDR.primitives.yaml index 4e113f7bfb..2fe46f3aa0 100644 --- a/clash-lib/prims/vhdl/Clash_Xilinx_DDR.primitives.yaml +++ b/clash-lib/prims/vhdl/Clash_Xilinx_DDR.primitives.yaml @@ -79,13 +79,13 @@ ~SYM[1] <= ~ARG[6]; ~SYM[2] <= ~ARG[7]; - ~GENSYM[gen_iddr][7] : for ~GENSYM[i][8] in ~SYM[3]'range generate + ~GENSYM[gen_oddr][7] : for ~GENSYM[i][8] in ~SYM[3]'range generate begin ~GENSYM[~COMPNAME_ODDR_inst][9] : ODDR generic map( DDR_CLK_EDGE => "SAME_EDGE", INIT => '0', - SRTYPE => ~IF ~ISSYNC[2] ~THEN "SYNC" ~ELSE "ASYNC" ~FI) + SRTYPE => ~IF ~ISSYNC[1] ~THEN "SYNC" ~ELSE "ASYNC" ~FI) port map ( Q => ~SYM[3](~SYM[8]), -- 1-bit DDR output C => ~ARG[3], -- 1-bit clock input