Test for arrayed interfaces (#2469).

This commit is contained in:
Josh Redford 2020-07-15 17:58:59 -04:00 committed by Wilson Snyder
parent bfea4b7f99
commit a18d8cbe86
2 changed files with 25 additions and 0 deletions

View File

@ -28,6 +28,7 @@ Jan Van Winkel
Jeremy Bennett
John Coiner
John Demme
Josh Redford
Julien Margetts
Kanad Kanhere
Kevin Kiningham

View File

@ -39,6 +39,19 @@ module ThingMuxOH
the_intf.t things_in [NTHINGS-1:0],
the_intf.i thing_out
);
assign thing_out.valid = things_in[0].valid;
endmodule
module ThingMuxShort
#(
parameter NTHINGS = 1,
parameter M = 5 )
(
input logic [NTHINGS-1:0] select_oh,
the_intf.t things_in [NTHINGS],
the_intf.i thing_out
);
assign thing_out.valid = things_in[0].valid;
endmodule
module Thinker
@ -55,8 +68,10 @@ module Thinker
the_intf #(.M(M)) curr_things [N-1:0] ();
the_intf #(.M(M)) prev_things [N-1:0] ();
the_intf #(.M(M)) s_things [N] ();
the_intf #(.M(M)) curr_thing ();
the_intf #(.M(M)) prev_thing ();
the_intf #(.M(M)) s_thing ();
logic [N-1:0] select_oh;
@ -78,6 +93,15 @@ module Thinker
.things_in( prev_things ),
.thing_out( prev_thing ));
// 3rd mux, using short array nomenclature:
ThingMuxShort #(
.NTHINGS ( N ),
.M ( M ))
s_thing_mux(
.select_oh( select_oh ),
.things_in( s_things ),
.thing_out( s_thing ));
endmodule
module t