data/full_repos/permissive/421030651/src/bus/peri_apb_conn.sv
1: b'%Warning-MULTITOP: data/full_repos/permissive/421030651/src/bus/peri_apb_conn.sv:2: Multiple top level modules\n                                                                                  : ... Suggest see manual; fix the duplicates, or use --top-module to select top.\n                   ... Use "/* verilator lint_off MULTITOP */" and lint_on around source to disable this message.\n                                                                                  : ... Top module \'peri_apb_conn\'\nmodule peri_apb_conn (\n       ^~~~~~~~~~~~~\n                                                                                  : ... Top module \'apb_intf\'\n    apb_intf.slave  peri_apb,\n    ^~~~~~~~\n%Error: data/full_repos/permissive/421030651/src/bus/peri_apb_conn.sv:2: Unsupported: Interfaced port on top level module\n    apb_intf.slave  peri_apb,\n                    ^~~~~~~~\n%Error: data/full_repos/permissive/421030651/src/bus/peri_apb_conn.sv:3: Unsupported: Interfaced port on top level module\n    apb_intf.master uart_apb,\n                    ^~~~~~~~\n%Error: data/full_repos/permissive/421030651/src/bus/peri_apb_conn.sv:4: Unsupported: Interfaced port on top level module\n    apb_intf.master spi_apb\n                    ^~~~~~~\n%Error: data/full_repos/permissive/421030651/src/bus/peri_apb_conn.sv:2: Cannot find file containing interface: \'apb_intf\'\n    apb_intf.slave  peri_apb,\n    ^~~~~~~~\n%Error: data/full_repos/permissive/421030651/src/bus/peri_apb_conn.sv:3: Cannot find file containing interface: \'apb_intf\'\n    apb_intf.master uart_apb,\n    ^~~~~~~~\n%Error: data/full_repos/permissive/421030651/src/bus/peri_apb_conn.sv:4: Cannot find file containing interface: \'apb_intf\'\n    apb_intf.master spi_apb\n    ^~~~~~~~\n%Error: Internal Error: data/full_repos/permissive/421030651/src/bus/peri_apb_conn.sv:2: ../V3LinkDot.cpp:2055: Unlinked interface\n    apb_intf.slave  peri_apb,\n    ^~~~~~~~\n'
module peri_apb_conn (
    apb_intf.slave  peri_apb,
    apb_intf.master uart_apb,
    apb_intf.master spi_apb
);

assign uart_apb.psel    = ~peri_apb.paddr[12] && peri_apb.psel;
assign uart_apb.penable = ~peri_apb.paddr[12] && peri_apb.penable;
assign uart_apb.paddr   =  peri_apb.paddr;
assign uart_apb.pwrite  =  peri_apb.pwrite;
assign uart_apb.pstrb   =  peri_apb.pstrb;
assign uart_apb.pprot   =  peri_apb.pprot;
assign uart_apb.pwdata  =  peri_apb.pwdata;

assign spi_apb.psel     =  peri_apb.paddr[12] && peri_apb.psel;
assign spi_apb.penable  =  peri_apb.paddr[12] && peri_apb.penable;
assign spi_apb.paddr    =  peri_apb.paddr;
assign spi_apb.pwrite   =  peri_apb.pwrite;
assign spi_apb.pstrb    =  peri_apb.pstrb;
assign spi_apb.pprot    =  peri_apb.pprot;
assign spi_apb.pwdata   =  peri_apb.pwdata;

assign peri_apb.prdata  =  peri_apb.paddr[12] ? spi_apb.prdata  : uart_apb.prdata;
assign peri_apb.pslverr =  peri_apb.paddr[12] ? spi_apb.pslverr : uart_apb.pslverr;
assign peri_apb.pready  =  peri_apb.paddr[12] ? spi_apb.pready  : uart_apb.pready;

endmodule
module peri_apb_conn (
    apb_intf.slave  peri_apb,
    apb_intf.master uart_apb,
    apb_intf.master spi_apb
);


assign uart_apb.psel    = ~peri_apb.paddr[12] && peri_apb.psel;
assign uart_apb.penable = ~peri_apb.paddr[12] && peri_apb.penable;
assign uart_apb.paddr   =  peri_apb.paddr;
assign uart_apb.pwrite  =  peri_apb.pwrite;
assign uart_apb.pstrb   =  peri_apb.pstrb;
assign uart_apb.pprot   =  peri_apb.pprot;
assign uart_apb.pwdata  =  peri_apb.pwdata;

assign spi_apb.psel     =  peri_apb.paddr[12] && peri_apb.psel;
assign spi_apb.penable  =  peri_apb.paddr[12] && peri_apb.penable;
assign spi_apb.paddr    =  peri_apb.paddr;
assign spi_apb.pwrite   =  peri_apb.pwrite;
assign spi_apb.pstrb    =  peri_apb.pstrb;
assign spi_apb.pprot    =  peri_apb.pprot;
assign spi_apb.pwdata   =  peri_apb.pwdata;

assign peri_apb.prdata  =  peri_apb.paddr[12] ? spi_apb.prdata  : uart_apb.prdata;
assign peri_apb.pslverr =  peri_apb.paddr[12] ? spi_apb.pslverr : uart_apb.pslverr;
assign peri_apb.pready  =  peri_apb.paddr[12] ? spi_apb.pready  : uart_apb.pready;

endmodule