- BlackBox:
    name: Clash.Prelude.ROM.asyncRom#
    kind: Declaration
    type: |-
      asyncRom#
        :: ( KnownNat n  -- ARG[0]
           , NFDataX a)  -- ARG[1]
        => Vec n a       -- ARG[2]
        -> Int           -- ARG[3]
        -> a
    template: |-
      // asyncRom begin
      wire ~TYPO ~GENSYM[ROM][0] [0:~LIT[0]-1];

      wire ~TYP[2] ~GENSYM[romflat][1];
      assign ~SYM[1] = ~CONST[2];
      genvar ~GENSYM[i][2];
      ~GENERATE
      for (~SYM[2]=0; ~SYM[2] < ~LIT[0]; ~SYM[2]=~SYM[2]+1) begin : ~GENSYM[mk_array][3]
        assign ~SYM[0][(~LIT[0]-1)-~SYM[2]] = ~SYM[1][~SYM[2]*~SIZE[~TYPO]+:~SIZE[~TYPO]];
      end
      ~ENDGENERATE

      assign ~RESULT = ~SYM[0][~ARG[3]];
      // asyncRom end
