ecp5: ECP5 synthesis fixes

Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
David Shah 2018-07-16 14:33:13 +02:00
parent 459d367913
commit b2c62ff8ef
3 changed files with 32 additions and 15 deletions

View File

@ -42,7 +42,7 @@ module _80_ecp5_alu (A, B, CI, BI, X, Y, CO);
function integer round_up2;
input integer N;
begin
round_up2 = ((N / 2) + 1) * 2;
round_up2 = ((N + 1) / 2) * 2;
end
endfunction
@ -69,7 +69,7 @@ module _80_ecp5_alu (A, B, CI, BI, X, Y, CO);
);
assign CO[i] = (AA[i] && BB[i]) || (C[i] && (AA[i] || BB[i]));
if (i < Y_WIDTH) begin
if (i+1 < Y_WIDTH) begin
assign CO[i+1] = FCO[i];
assign Y[i+1] = Y1[i];
end

View File

@ -67,10 +67,15 @@ module TRELLIS_RAM16X2 (
wire muxwck = (WCKMUX == "INV") ? ~WCK : WCK;
wire muxwre = (WREMUX == "1") ? 1'b1 :
(WREMUX == "0") ? 1'b0 :
(WREMUX == "INV") ? ~WRE :
WRE;
reg muxwre;
always @(*)
case (WREMUX)
"1": muxwre = 1'b1;
"0": muxwre = 1'b0;
"INV": muxwre = ~WRE;
default: muxwre = WRE;
endcase
always @(posedge muxwck)
if (muxwre)
@ -108,10 +113,14 @@ module TRELLIS_DPR16X4 (
wire muxwck = (WCKMUX == "INV") ? ~WCK : WCK;
wire muxwre = (WREMUX == "1") ? 1'b1 :
(WREMUX == "0") ? 1'b0 :
(WREMUX == "INV") ? ~WRE :
WRE;
reg muxwre;
always @(*)
case (WREMUX)
"1": muxwre = 1'b1;
"0": muxwre = 1'b0;
"INV": muxwre = ~WRE;
default: muxwre = WRE;
endcase
always @(posedge muxwck)
if (muxwre)
@ -167,7 +176,7 @@ module DPR16X4C (
integer i;
initial begin
for (i = 0; i < 15; i = i + 1) begin
ram[i] = conv_initval[4*i +: 4];
ram[i] <= conv_initval[4*i +: 4];
end
end
@ -189,10 +198,14 @@ module TRELLIS_FF(input CLK, LSR, CE, DI, output reg Q);
parameter SRMODE = "LSR_OVER_CE";
parameter REGSET = "RESET";
wire muxce = (CEMUX == "1") ? 1'b1 :
(CEMUX == "0") ? 1'b0 :
(CEMUX == "INV") ? ~CE :
CE;
reg muxce;
always @(*)
case (CEMUX)
"1": muxce = 1'b1;
"0": muxce = 1'b0;
"INV": muxce = ~CE;
default: muxce = CE;
endcase
wire muxlsr = (LSRMUX == "INV") ? ~LSR : LSR;
wire muxclk = (CLKMUX == "INV") ? ~CLK : CLK;

View File

@ -172,6 +172,10 @@ struct SynthEcp5Pass : public ScriptPass
nodram = true;
continue;
}
if (args[argidx] == "-nomux") {
nomux = true;
continue;
}
if (args[argidx] == "-abc2") {
abc2 = true;
continue;