- BlackBox:
    name: Clash.Prelude.ROM.asyncRom#
    kind: Declaration
    type: |-
      asyncRom# :: KnownNat n -- ^ ARG[0]
                 => Vec n a    -- ^ ARG[1]
                 -> Int        -- ^ ARG[2]
                 -> a
    template: |-
      -- asyncRom begin
      ~GENSYM[asyncRom][0] : block
        signal ~GENSYM[ROM][1] : ~TYP[1];
        signal ~GENSYM[rd][2] : integer range 0 to ~LIT[0]-1;
      begin
        ~SYM[1] <= ~CONST[1];

        ~SYM[2] <= to_integer(~VAR[rdI][2](31 downto 0))
        -- pragma translate_off
                            mod ~LIT[0]
        -- pragma translate_on
                            ;~IF ~VIVADO ~THEN
        ~RESULT <= ~FROMBV[~SYM[1](~SYM[2])][~TYPO];~ELSE
        ~RESULT <= ~SYM[1](~SYM[2]);~FI
      end block;
      -- asyncRom end
