`define checkh(gotv,expv) do if ((gotv) !== (expv)) begin $write("%%Error: %s:%0d: got='h%x exp='h%x\n", `__FILE__,`__LINE__, (gotv), (expv)); `stop; end while(0)
interfaceintf();
integervalue;
endinterface
modulefanout
#(parameterintN=1)
(
intfupstream,
intfdownstream[N-1:0]
);
genvari;
for(i=0;i<N;i=i+1)
assigndownstream[i].value=upstream.value;
endmodule
modulexbar
(
inputlogicclk,
inputintcyc,
intfMasters[1:0]
);
localparamNUM_DEMUX_OUT=2*4;
localparamNUM_MUX_IN=2*4;
intfdemuxOut[NUM_DEMUX_OUT-1:0]();
intfmuxIn[NUM_MUX_IN-1:0]();
//fan out master connections to the crossbar matrix
fanout#(.N(4))fanout_inst0
(.upstream(Masters[0]),
.downstream(demuxOut[3:0]));
fanout#(.N(4))fanout_inst1
(.upstream(Masters[1]),
.downstream(demuxOut[7:4]));
//the crossbar matrix assignments, done as 1D arrays because verilator doesn't currently support >1D arrays of interfaces