I wanted to see if anyone had some ideas about why I would be getting the following error in lattice radiant synthesis (note ive also reached out to lattice to resolve this issue and im just looking for ideas syntactically):
‘ERROR default field of an assignment pattern cannot contain another assignment pattern’
Ill explain the setup below:
I have a package that looks like this:
package lib_parser_pkg;
localparam NUM_PSTACK = 256;
localparam PROT_DEPTH = 8;typedef hdr::pkt_types_e stack_t [NUM_PSTACK][PROT_DEPTH];
endpackage : lib_parser_pkg
I than feed and define this as a parameter value into modules as the following:
parameter lib_parser_pkg::stack_t PSTACKS = '{ 0:'{0:hdr::ETH, default:hdr::UNKNOWN}, 1:'{0:hdr::ETH, 1:hdr::IPV4, default:hdr::UNKNOWN}, 2:'{0:hdr::ETH, 1:hdr::IPV6, default:hdr::UNKNOWN}, default: '{default:hdr::UNKNOWN} },
Ultimately, I do this so that I can just loop until I see UNKOWN and I know ive reached the end since the pstacks value can vary from module to module.
The fix ive found for this error currently is that the tool doesnt like having a default within a default and would look like this:
parameter lib_parser_pkg::stack_t PSTACKS = '{ 0:'{0:hdr::ETH, default:hdr::UNKNOWN}, 1:'{0:hdr::ETH, 1:hdr::IPV4, default:hdr::UNKNOWN}, 2:'{0:hdr::ETH, 1:hdr::IPV6, default:hdr::UNKNOWN}, default: hdr::UNKNOWN },
Does anyone know of a good way to initialize a 2-d array with default values without knowing the size ahead of time.
**NOTE that the first option works for intel, but not for lattice