Forum Discussion

Allen0204's avatar
Allen0204
Icon for New Contributor rankNew Contributor
10 months ago

Modelsim sim force ariables in a two-dimensional array

How to use modelsim force variables in a two-dimensional array

3 Replies

  • You may find the answer below:

    For Verilog:

    If you have a two-dimensional array like this:

    reg [7:0] mem [0:3]; // 4x8-bit array


    For a multi-bit element inside an array:

    reg [3:0] mem [0:3][0:1]; // 4x2 array of 4-bit registers


    For VHDL:

    If you have a two-dimensional array:

    type mem_array is array (0 to 3, 0 to 1) of std_logic_vector(3 downto 0);

    signal mem : mem_array;


  • As we do not receive any response from you on the previous answer that we have provided. Please login to ‘https://supporttickets.intel.com/s/?language=en_US’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.