Home > Community > Forums > Functional Verification > how to create memory model using vr_ad

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 how to create memory model using vr_ad 

Last post Tue, May 8 2007 8:54 PM by archive. 5 replies.
Started by archive 08 May 2007 08:54 PM. Topic has 5 replies and 1607 views
Page 1 of 1 (6 items)
Sort Posts:
  • Tue, May 8 2007 8:54 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    how to create memory model using vr_ad Reply

    Hi,

        I wanted to know how i can create a memory model using vr_rd package.

    --srik.


    Originally posted in cdnusers.org by srik
    • Post Points: 0
  • Wed, May 9 2007 2:20 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: how to create memory model using vr_ad Reply

    Hi Srik.

    Have you used vr_ad at all before? If not, I suggest you read the documentation and look at the examples that come with vr_ad.
    The vr_ad (and the documentation) is part of IPCM, so get that first if you don't have it.

    vr_ad lets you model really simple sparse memories by default, and also lets you overlay an e struct onto the memory, to give you a structured way to address the memory.

    I've pasted a snippet from the IPCM6.1 docs to get you started:

    Utilities

    4 Register and Memory Modeling Package

    4.7 Sparse Memory

    4.7.1 Instantiating a Memory


    To instantiate a memory:

       1. Extend vr_ad_mem_kind, and add a new kind (according to eRM naming conventions).

          For example, you could add the kind EX_MEM as follows:
          extend vr_ad_mem_kind : [EX_MEM];
       2. Extend the relevant unit by adding a field of the specific vr_ad_mem subtype, and constrain the memory to the appropriate size.

          For example, you could set a 1Kx64 memory as follows:
          extend ACTIVE SLAVE vr_xbus_agent {
              mem : EX_MEM vr_ad_mem;
                  keep mem.size == 0x1024;
                  keep mem.addressing_width_in_bytes == 8;
          };

       3. Add the memory to the address space using add_with_offset() (same as adding a register file)

          For example, assuming that the memories of the slaves are mapped in consecutive addresses, you could map all active XBus slaves as follows:
          extend vr_xbus_env {
              post_generate() is also {
                  for each (slave) in active_slaves {
                      addr_map.add_with_offset(index*1000,slave.mem);   
                  };
              };
          };


    Hope this helps!

    Steve.


    Originally posted in cdnusers.org by stephenh
    • Post Points: 0
  • Wed, May 9 2007 9:13 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: how to create memory model using vr_ad Reply

    Thank you steve.

    --Srik.


    Originally posted in cdnusers.org by srik
    • Post Points: 0
  • Mon, Jan 14 2008 8:10 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: how to create memory model using vr_ad Reply

    I would also look at another option - defining your memory as a list of regs. Very useful if the data is constructed from meaningful fields. For example :

    reg_def YYY {
    -- NAME TYPE R/W RESET Cover
    reg_fld reserved: uint(bits:7) : R : 0 ;
    reg_fld valid : bit : RW : 0 : cov;
    };

    extend XXX vr_ad_reg_file {
    memory_l[512]: list of YYY vr_ad_reg;

    post_generate() is also {
    for each in memory_l do {
    add_with_offset(OFFSET + 2_000 +(index*4),it);
    it.reset();
    };
    };
    };


    Originally posted in cdnusers.org by thinkverification
    • Post Points: 0
  • Mon, Jan 14 2008 8:39 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: how to create memory model using vr_ad Reply

    The last suggested method for the modeling is generally used to model the actual register space of the DUT.
    As suggested we can define the register and its fields by reg_def and reg_fld macro.
    A very good explanation is given for using the same in vr_ad document.

    If memory is constructed with some meaningful field than we can create the objects with mem_obj_def macro and than fields can be created inside.

    For Ex:

    mem_obj_def obj-name {
    mem_fld field-name : field-type [: cov];
    };

    A very good explanation is given in vr_ad document under the heading "Storing Complex Structures in Memory".

    --
    Regards,
    Gaurav Patel
    ASIC Engineer.
    www.einfochips.com


    Originally posted in cdnusers.org by er_gauravpatel
    • Post Points: 0
  • Tue, Jan 15 2008 12:09 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: how to create memory model using vr_ad Reply

    Thanks for pointing this out, Gaurav.

    However, I've found that using list of vr_ad_regs to model memory is very convenient for modeling indirect access memories where the "indirect-data-write" register is of the exact same type as the list of vr_ads. You only have to define field structure once.


    Originally posted in cdnusers.org by thinkverification
    • Post Points: 0
Page 1 of 1 (6 items)
Sort Posts:
Started by archive at 08 May 2007 08:54 PM. Topic has 5 replies.