data/full_repos/permissive/421030651/src/bus/core_apb_conn.sv
1: b'%Warning-MULTITOP: data/full_repos/permissive/421030651/src/bus/core_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 \'core_apb_conn\'\nmodule core_apb_conn (\n       ^~~~~~~~~~~~~\n                                                                                  : ... Top module \'apb_intf\'\n    apb_intf.slave  core_apb,\n    ^~~~~~~~\n%Error: data/full_repos/permissive/421030651/src/bus/core_apb_conn.sv:2: Unsupported: Interfaced port on top level module\n    apb_intf.slave  core_apb,\n                    ^~~~~~~~\n%Error: data/full_repos/permissive/421030651/src/bus/core_apb_conn.sv:3: Unsupported: Interfaced port on top level module\n    apb_intf.master cfgreg_apb,\n                    ^~~~~~~~~~\n%Error: data/full_repos/permissive/421030651/src/bus/core_apb_conn.sv:4: Unsupported: Interfaced port on top level module\n    apb_intf.master dbgmon_apb,\n                    ^~~~~~~~~~\n%Error: data/full_repos/permissive/421030651/src/bus/core_apb_conn.sv:5: Unsupported: Interfaced port on top level module\n    apb_intf.master intc_apb\n                    ^~~~~~~~\n%Error: data/full_repos/permissive/421030651/src/bus/core_apb_conn.sv:2: Cannot find file containing interface: \'apb_intf\'\n    apb_intf.slave  core_apb,\n    ^~~~~~~~\n%Error: data/full_repos/permissive/421030651/src/bus/core_apb_conn.sv:3: Cannot find file containing interface: \'apb_intf\'\n    apb_intf.master cfgreg_apb,\n    ^~~~~~~~\n%Error: data/full_repos/permissive/421030651/src/bus/core_apb_conn.sv:4: Cannot find file containing interface: \'apb_intf\'\n    apb_intf.master dbgmon_apb,\n    ^~~~~~~~\n%Error: data/full_repos/permissive/421030651/src/bus/core_apb_conn.sv:5: Cannot find file containing interface: \'apb_intf\'\n    apb_intf.master intc_apb\n    ^~~~~~~~\n%Error: Internal Error: data/full_repos/permissive/421030651/src/bus/core_apb_conn.sv:2: ../V3LinkDot.cpp:2055: Unlinked interface\n    apb_intf.slave  core_apb,\n    ^~~~~~~~\n'
module core_apb_conn (
    apb_intf.slave  core_apb,
    apb_intf.master cfgreg_apb,
    apb_intf.master dbgmon_apb,
    apb_intf.master intc_apb
);

assign cfgreg_apb.psel    = ~core_apb.paddr[27] && ~|core_apb.paddr[13:12] && core_apb.psel;
assign cfgreg_apb.penable = ~core_apb.paddr[27] && ~|core_apb.paddr[13:12] && core_apb.penable;
assign cfgreg_apb.paddr   = core_apb.paddr;
assign cfgreg_apb.pwrite  = core_apb.pwrite;
assign cfgreg_apb.pstrb   = core_apb.pstrb;
assign cfgreg_apb.pprot   = core_apb.pprot;
assign cfgreg_apb.pwdata  = core_apb.pwdata;

assign dbgmon_apb.psel    = ~core_apb.paddr[27] && core_apb.paddr[13] && core_apb.psel;
assign dbgmon_apb.penable = ~core_apb.paddr[27] && core_apb.paddr[13] && core_apb.penable;
assign dbgmon_apb.paddr   = core_apb.paddr;
assign dbgmon_apb.pwrite  = core_apb.pwrite;
assign dbgmon_apb.pstrb   = core_apb.pstrb;
assign dbgmon_apb.pprot   = core_apb.pprot;
assign dbgmon_apb.pwdata  = core_apb.pwdata;

assign intc_apb.psel      = core_apb.paddr[27] && core_apb.psel;
assign intc_apb.penable   = core_apb.paddr[27] && core_apb.penable;
assign intc_apb.paddr     = core_apb.paddr;
assign intc_apb.pwrite    = core_apb.pwrite;
assign intc_apb.pstrb     = core_apb.pstrb;
assign intc_apb.pprot     = core_apb.pprot;
assign intc_apb.pwdata    = core_apb.pwdata;

assign core_apb.prdata    =  core_apb.paddr[27] ? intc_apb.prdata:
                             core_apb.paddr[13] ? dbgmon_apb.prdata:
                            ~core_apb.paddr[12] ? cfgreg_apb.prdata:
                                                  32'hdeadbeef;
assign core_apb.pslverr   =  core_apb.paddr[27] ? intc_apb.pslverr:
                             core_apb.paddr[13] ? dbgmon_apb.pslverr:
                            ~core_apb.paddr[12] ? cfgreg_apb.pslverr:
                                                  1'b1;
assign core_apb.pready    =  core_apb.paddr[27] ? intc_apb.pready:
                             core_apb.paddr[13] ? dbgmon_apb.pready:
                            ~core_apb.paddr[12] ? cfgreg_apb.pready:
                                                  1'b1;

endmodule
module core_apb_conn (
    apb_intf.slave  core_apb,
    apb_intf.master cfgreg_apb,
    apb_intf.master dbgmon_apb,
    apb_intf.master intc_apb
);


assign cfgreg_apb.psel    = ~core_apb.paddr[27] && ~|core_apb.paddr[13:12] && core_apb.psel;
assign cfgreg_apb.penable = ~core_apb.paddr[27] && ~|core_apb.paddr[13:12] && core_apb.penable;
assign cfgreg_apb.paddr   = core_apb.paddr;
assign cfgreg_apb.pwrite  = core_apb.pwrite;
assign cfgreg_apb.pstrb   = core_apb.pstrb;
assign cfgreg_apb.pprot   = core_apb.pprot;
assign cfgreg_apb.pwdata  = core_apb.pwdata;

assign dbgmon_apb.psel    = ~core_apb.paddr[27] && core_apb.paddr[13] && core_apb.psel;
assign dbgmon_apb.penable = ~core_apb.paddr[27] && core_apb.paddr[13] && core_apb.penable;
assign dbgmon_apb.paddr   = core_apb.paddr;
assign dbgmon_apb.pwrite  = core_apb.pwrite;
assign dbgmon_apb.pstrb   = core_apb.pstrb;
assign dbgmon_apb.pprot   = core_apb.pprot;
assign dbgmon_apb.pwdata  = core_apb.pwdata;

assign intc_apb.psel      = core_apb.paddr[27] && core_apb.psel;
assign intc_apb.penable   = core_apb.paddr[27] && core_apb.penable;
assign intc_apb.paddr     = core_apb.paddr;
assign intc_apb.pwrite    = core_apb.pwrite;
assign intc_apb.pstrb     = core_apb.pstrb;
assign intc_apb.pprot     = core_apb.pprot;
assign intc_apb.pwdata    = core_apb.pwdata;

assign core_apb.prdata    =  core_apb.paddr[27] ? intc_apb.prdata:
                             core_apb.paddr[13] ? dbgmon_apb.prdata:
                            ~core_apb.paddr[12] ? cfgreg_apb.prdata:
                                                  32'hdeadbeef;
assign core_apb.pslverr   =  core_apb.paddr[27] ? intc_apb.pslverr:
                             core_apb.paddr[13] ? dbgmon_apb.pslverr:
                            ~core_apb.paddr[12] ? cfgreg_apb.pslverr:
                                                  1'b1;
assign core_apb.pready    =  core_apb.paddr[27] ? intc_apb.pready:
                             core_apb.paddr[13] ? dbgmon_apb.pready:
                            ~core_apb.paddr[12] ? cfgreg_apb.pready:
                                                  1'b1;

endmodule