// Hand-coded demo. Not auto-generated package top_pkg; // top.whee[][].y typedef struct { logic value; } top__wheexx__y__out_t; // top.whee[][] typedef struct { top__wheexx__y__out_t y; } top__wheexx__out_t; // top.asdf[].aaa[].abc typedef struct { logic [14:0] value; } top__asdfx__aaax__abc__out_t; // top.asdf[].aaa[].def typedef struct { logic [3:0] value; } top__asdfx__aaax__def__out_t; // top.asdf[].aaa[] typedef struct { top__asdfx__aaax__abc__out_t abc; top__asdfx__aaax__def__out_t def; } top__asdfx__aaax__out_t; // top.asdf[].bbb.abc typedef struct { logic value; } top__asdfx__bbb__abc__out_t; // top.asdf[].bbb.def typedef struct { logic value; } top__asdfx__bbb__def__out_t; // top.asdf[].bbb typedef struct { top__asdfx__bbb__abc__out_t abc; top__asdfx__bbb__def__out_t def; } top__asdfx__bbb__out_t; // top.asdf[] typedef struct { top__asdfx__aaax__out_t aaa[4]; top__asdfx__bbb__out_t bbb; } top__asdfx__out_t; // top typedef struct { top__wheexx__out_t whee[2][8]; top__asdfx__out_t asdf[20]; } top__out_t; endpackage module top #( // TODO: pipeline parameters )( input wire clk, input wire rst, apb4_intf.slave s_apb, output top_pkg::top__out_t hwif_out ); localparam ADDR_WIDTH = 32; localparam DATA_WIDTH = 32; //-------------------------------------------------------------------------- // CPU Bus interface logic //-------------------------------------------------------------------------- logic cpuif_req; logic cpuif_req_is_wr; logic [ADDR_WIDTH-1:0] cpuif_addr; logic [DATA_WIDTH-1:0] cpuif_wr_data; logic [DATA_WIDTH-1:0] cpuif_wr_bitstrb; logic cpuif_rd_ack; logic [DATA_WIDTH-1:0] cpuif_rd_data; logic cpuif_rd_err; logic cpuif_wr_ack; logic cpuif_wr_err; begin // Request logic is_active; always_ff @(posedge clk) begin if(rst) begin is_active <= '0; cpuif_req <= '0; cpuif_req_is_wr <= '0; cpuif_addr <= '0; cpuif_wr_data <= '0; cpuif_wr_bitstrb <= '0; end else begin if(~is_active) begin if(s_apb.psel) begin is_active <= '1; cpuif_req <= '1; cpuif_req_is_wr <= s_apb.pwrite; cpuif_addr <= s_apb.paddr[ADDR_WIDTH-1:0]; cpuif_wr_data <= s_apb.pwdata; for(int i=0; i