#40 array querying system functions

open
Cary R.
None
5
2013-12-19
2012-03-31
Iztok Jeras
No

Hi,

There is a set of system functions that can be used to determine the properties of an array. Implementing this functions should also help with checking if packed array support is implemented correctly. The next functions are tested in the example:
$dimensions
$left
$right
$low
$high
$increment
$size

Use the example code from: https://github.com/jeras/ivtest/tree/test_sv
iverilog -g2009 ivltests/array_packed_sysfunct.v && vvp a.out
or the attached file.

Regards,
Iztok Jeras

Discussion

  • Iztok Jeras
    Iztok Jeras
    2012-03-31

    example Verilog code

     
  • Cary R.
    Cary R.
    2013-07-29

    • assigned_to: Cary R.
     
  • Cary R.
    Cary R.
    2013-07-29

    I'm going to look at adding these functions.

     
  • Cary R.
    Cary R.
    2013-12-19

    I have pushed a patch for development that handles these when they can be computed in the compiler. There is some missing infrastructure in the run time that needs to be added before I can add the run time versions.

    The specifics are $dimensions() and $unpacked_dimensions() should work for all cases that Icarus currently supports. The rest should work if the second argument is omitted or is a constant except for strings and dynamic arrays which have a size that depends on their run time context.