system verilog - Modport trouble using complex struct -
From my previous question (), after creating Typeface Stracts, I try to create an interface with 5 different channel signal declarations Of Structs).
The form of structure is:
typedef struct {struct {logic [1: 0] A; Logic [2: 0] b; } In; Structure {logic [4: 0] d; } outside; } Axi_X_ch; Then I tried the following code:
interface axi_interface (); // as = axi slave axi_x_ch as_X; Axi_Y_ch as_Y; // Axi_X_ch Modort slave similar to structure (input as_X.in, as_Y.in, output as_X.out, as_Y.out); Endinthes but I get the error message (ignore coordinates): Modort slave (input as_X.in, as_Y .in, output as_X.out, as_y.out); | Ncvlog: * E, ILLHIN (Demo SV, 177 | 30): Invalid location for a hierarchical name (as_X). Modod Slaves (Input as_X.in, as_y.in, Output as_X.out, as_Y.out); | Ncvlog: * E, ILLHIN (Demo SV, 177 | 30): Invalid location for a hierarchical name (as_y). ... (for the next two output announcements) ... What am I doing?
There should be variables inside the mode port, and not their share. In addition, you are referring to your modort items as type, not the variable:
Modort slave (Input axi_X_ch.in, axi_Y_ch.in, output axi_X_ch.out, axi_Y_ch.out ); axi_x_ch is a type, not a variable. Do you want to get something that can be done with the name "if all the synthesis tools support it").
Then, using the modong expression, you get the new port name called X_IN, Y_IN, X_OUT, Y_OUT : Modort slave (Input) Can create. X_IN (as_X.in), .Y_IN (as_Y.in), output X_OUT (as_X.out), output .Y_OUT (as_Y.out)); If edit: If the modong expressions are not supported, then the closest thing I can think is:
typed Strip {Logic [1: 0] A; Logic [2: 0] b; } T_in; Typefif Structure {Logic [4: 0] D; } T_out; Interface axi_interface (); T_in as_X_in; T_out as_X_out; T_in as_y_in; T_out as_Y_out; Modport Slave (input as_X_in, as_y_in, output as_X_out, as_y_out); Endinfterface This loses part of a grouping that you are trying to achieve.
Comments
Post a Comment