package Test20; import ModuleCollect::*; import List::*; import ListN::*; interface Condition; method Integer index; method Bool condition; endinterface typedef ModuleCollect#(Condition, i) CondModule#(type i); interface CondWires#(type n); method Bit#(n) wires; method Action clear; endinterface module [Module] mkCondWrapper#(CondModule#(Empty) mkM)(CondWires#(n)); IWithCollection#(Condition, Empty) ecs(); exposeCollection#(mkM) the_dut(ecs); let cs = ecs.collection; Reg#(Bit#(1)) rs[valueOf(n)]; for (Integer i=0; i