Altera_Forum
Honored Contributor
12 years agoSystemVerilog Interface Synthesis Quartus 13
Quartus 13 Synthesis has the limitation that interface attributes cannot be used conveniently in a module. I am looking for a work around as this limitation does not appear in other tools.
Given a simple SV interface definition:interface avalon_bus
#(
parameter ADDR_WIDTH = 16,
parameter DATA_WIDTH = 8
)
(
input logic clock,
input logic reset
);
// aliais/short-cut for address and data widths
localparam AW = ADDR_WIDTH-1;
localparam DW = DATA_WIDTH-1;
localparam MaxAddress = 2**ADDR_WIDTH;
logic address;
logic writedata;
logic readdata;
modport per (
input clock,
input reset,
input address,
input writedata,
output readdata
);
endinterface
and a module that uses the interface: module avalon_mux
(
interface bus
);
localparam AddrThreshold = bus.MaxAddress/2;
logic pipe_a, pipe_b;
always @(posedge bus.clock) begin
if (busin.address <= AddrThreshold) begin
pipe_a <= bus.writedata;
end else begin
pipe_b <= bus.writedata;
end
end
endmodule
Quartus throws errors because it does not like the use of the "hierarchy separator" in most expressions. Does anyone know of a work around? Example, is there another way to express / localparam AddrThreshold = bus.MaxAddress/2 /? I have tried / const integer / and some other hacks but no luck, yet :( I have also attached an example Quartus project. Regards, Chris