Any way/hints to debug ABC pass? #3852
-
The problemThe issue is that before assign \lpc_periph_inst.interrupt = _1079_ &(* src = "TwPM_Top.v:143.15-165.4|verilog-tpm-fifo-registers/regs_module.v:484.22-486.46" *) _1092_; which is gone after running:
At the end, assign \lpc_periph_inst.interrupt = 1'h0; The result is obviously wrong, but how to trace what's going on? There are some warnings during synthesis, but they don't seem too related and the reduced version below has only limited number of them:
CodeThe full code is here, I shortened it via reduced.v
module TwPM_Top (LCLK, LRESET, LAD, SERIRQ);
input LCLK;
input LRESET;
inout [3:0] LAD;
inout SERIRQ;
wire [7:0] data_lpc2dp;
wire interrupt;
lpc_periph lpc_periph_inst (
.clk_i(LCLK),
.nrst_i(LRESET),
.lad_bus(LAD),
.serirq(SERIRQ),
.lpc_data_o(data_lpc2dp),
.interrupt(interrupt)
);
assign interrupt = data_lpc2dp[7] & |data_lpc2dp[3:0];
endmodule
module lpc_periph (clk_i, nrst_i, lad_bus, serirq, lpc_data_o, interrupt);
input wire clk_i; // LPC clock
input wire nrst_i; // LPC reset (active low)
inout wire [ 3:0] lad_bus; // LPC data bus
inout wire serirq; // LPC SERIRQ signal
output reg [ 7:0] lpc_data_o; // Data received (I/O Write) from host
input wire interrupt; // Whether interrupt should be signaled to host, active high
reg driving_serirq = 0; // Enable signal for driving SERIRQ by LPC module
reg [ 3:0] irq_num_reg = 0; // IRQ number, latched on SERIRQ start frame
reg serirq_reg = 1; // Value driven on SERIRQ, if enabled
always @(negedge nrst_i or posedge clk_i) begin : serirq_drive
integer serirq_counter;
if (nrst_i) begin
if (interrupt) begin
driving_serirq <= 1;
end
if (serirq_counter == irq_num_reg * 3 + 1 && driving_serirq) begin
driving_serirq <= 0; // Turn-around
end
lpc_data_o[3:0] <= lad_bus;
lpc_data_o[7:4] <= lad_bus;
end else begin
serirq_counter <= 0;
serirq_reg <= 1;
driving_serirq <= 0;
end
end
assign serirq = driving_serirq ? serirq_reg : 1'bz;
endmodule Any thoughts?Is it limited support of tri-state logic in |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Generally speaking, tri-states are not synthesizable. If I recall correctly, |
Beta Was this translation helpful? Give feedback.
You can have tri-states at the boundary of the FPGA, and essentially every FPGA has the ability to do so.
But you cannot have tri-states inside of the FPGA, between two of the modules you synthesize.