Assign RandInt to record results in error

Why OSVVM™? Forums OSVVM Assign RandInt to record results in error

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1034
    Sean Winfree
    Member

     type t_Config is record
        Mod         : natural range 0 to 3;
        ...
        ...
     end record t_Config;
     
     CONFIG          : t_config;
     variable ModVar : natural range 0 to 3;
     
     ModVar     := RV.RandInt(0,3);  -- WORKS
     CONFIG.Mod := RV.RandInt(0,3);  -- ERROR

    All of this is done in testbench.
    Getting ModelSim error ""CONFIG" cannot be target of variable assignment statement."
    Any ideas on easy work around? Being able to assign random numbers to records will
    greatly reduce typing.

     

        

    #1035
    Sean Winfree
    Member

    *never mind. issue can be deleted from forum. answer was simply CONFIG was not a variable.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.