• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification Shared Code
  3. vr_ad register definition utility

Stats

  • Locked Locked
  • Replies 20
  • Subscribers 40
  • Views 35304
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

vr_ad register definition utility

StephenH
StephenH over 16 years ago

Hi All.

I put together a small Perl script to generate vr_ad register definitions from SPIRIT (IP-XACT) XML.
If you've got not idea what IP-XACT is, have a look here www.spiritconsortium.org/, then start pestering your design manager to use it :-)

The script can filter out registers and override R/W access types if needed.

An example XML file is included with the package so that you can play with it, and there's a detailed README.txt as well.

Here's an example of the generated e code:

// Automatically generated from xdmac.xml
// DO NOT EDIT, or your changes may be lost
<'

import vr_ad/e/vr_ad_top;

// Component = XDMAC
// memoryMap = xdmac
extend vr_ad_map_kind : [XDMAC];

// addressBlock = dma_eth
extend vr_ad_reg_file_kind : [DMA_ETH];

extend DMA_ETH vr_ad_reg_file {
keep size == 20;
keep addressing_width_in_bytes == 4;
};

// Register = command
// Reset = 0x00
reg_def COMMAND DMA_ETH 0x0 {
// Field resv3 = command[31:29]
reg_fld resv3 : uint(bits:3) : R : 0 : cov ;
// Field transfer_size = command[28:19]
reg_fld transfer_size : uint(bits:10) : RW : 0 : cov ;
// Field dma_transfer_target = command[18:14]
reg_fld dma_transfer_target : uint(bits:5) : RW : 0 : cov ;
// Field resv2 = command[13:10]
reg_fld resv2 : uint(bits:4) : R : 0 : cov ;
// Field transmit_receive = command[9:9]
reg_fld transmit_receive : uint(bits:1) : RW : 0 : cov ;
// Field resv1 = command[8:5]
reg_fld resv1 : uint(bits:4) : R : 0 : cov ;
// Field dest_address_enable = command[4:4]
reg_fld dest_address_enable : uint(bits:1) : RW : 0 : cov ;
// Field source_address_enable = command[3:3]
reg_fld source_address_enable : uint(bits:1) : RW : 0 : cov ;
// Field word_size = command[2:0]
reg_fld word_size : uint(bits:3) : R : 0 : cov ;
};

// Register = queue_exec
// Reset = 0x00
reg_def QUEUE_EXEC DMA_ETH 0x10 {
// Field resv = queue_exec[31:1]
reg_fld resv : uint(bits:31) : R : 0 : cov ;
// Field exec = queue_exec[0:0]
reg_fld exec : uint(bits:1) : RW : 0 : cov ;
};

extend XDMAC vr_ad_map {
dma_eth : DMA_ETH vr_ad_reg_file;

post_generate() is also {
add_with_offset(0x00, dma_eth);
dma_eth.reset();
};
}
'>

 

Any comments, please feed them back to me so I can enhance the script.
Note that this forum forces me to post a .zip file rather than .tgz, please be careful to unpack the file under Linux, not Windows, else the DOS linefeeds will corrupt the Perl and XML files.

Steve

ipxact2vrad-0.7.zip
  • Cancel
  • tauf
    tauf over 13 years ago

    Hi Stephan,

     

    Thanks for your info!

     

    Basically  am working for STMicro , and already contacted local cadence support guy for  additional features request. We recently download 12.1 latest version vr_ad.

     And am tryingt o integrate with AHB lite0, where I followed the steps for integration given in vr_ad examples directory. When I try to run a simple  test to write & read reg. The compilation goes well when it comes to run it,s throwing an error something like this

         *** Warning: WARN_GEN_SAMPLING_FAILURE_IN_HARD: The sampling of the

    input: value(driver.addr_map.kind), has failed.

    To debug, run with 'br error'. To get the relevant generation data, run additionally with 'br gen error' and use 'gtree' to open the Gen Debugger.

            at line 114 in @vr_ad_sequence_h

           keep map_kind == value(driver.addr_map.kind);

            To change the severity, type:

         set notify -severity=IGNORE|NOTE|WARNING|ERROR

          WARN_GEN_SAMPLING_FAILURE_IN_HARD

        *** Error: struct is NULL - cannot access field 'addr_map'

            at line 114 in @vr_ad_sequence_h

           keep map_kind == value(driver.addr_map.kind);

     My concern here is , have cross checked address mapping and reg files, for me seems everything okay as per instructions.

     Do you have any idea about the above error? 

     One more query, the access policies support in your script file, do they all supported directly by vr_ad? 

    Many Thanks

    Thoufiq 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • IonutC
    IonutC over 13 years ago

     Hello tauf,

    I encountered the same error as you have and traced the cause to the RSD (Register Sequence Driver) not being properly connected to the BFM Sequence Drivers.
    Take a closer look over possible pointer connections between sequence drivers, especially if you are using Virtual Sequence Drivers in combination with layered RSD and other BFM SDs.

    Hope I was of help

    Ionut Ciocirlan

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • tauf
    tauf over 12 years ago

    Hi Stephan,

    I am currently using vr_ad reg model in my environment, in one of my register bits are define as "Uninitialized" with 'U'. And it described in spec that it is read only and by doing read operation it should return 'U'.  It,s like unknow value X.

    But according to vr_ad , all I can see is don,t care for reserved or unused bit which will return  either '0' or '1' by executing read operation.

    Could you please tell me , is this policy possible i.e returning 'U' during read operation for that particular bit. 

    Thanks

    Thoufiq 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • nannasin28
    nannasin28 over 12 years ago

     updating the reg model from the testbench.

    TDA2822
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • tauf
    tauf over 12 years ago

    Hi Stephan

     Hi Stephan, I am writing sequences for vr_ad, I found predefined sequences such as reset check and random read and write. However unable to find writing FFFFFFFF & 00000000 to all registers in def file like walking pattern or bit bash etc.

    Can you please guide me how to write this, as I try to declare one more filed in random read write sequences as FFFFFFFFF data, but it,s not working.

    Please post me this sequence so that can move forward

    I am doing something like this

    for each (r) in reglist{

    do op keeping {

    .static_item=r;

    .direction == write;

    };

    in the above code , have no idea how to add data field as 0xFFFFFFFFFF and 0X0000000000; 

    Thanks 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • tauf
    tauf over 12 years ago

    Hello,

     Hi Stephan, I am writing sequences for vr_ad, I found predefined sequences such as reset check and random read and write. However unable to find writing FFFFFFFF & 00000000 to all registers in def file like walking pattern or bit bash etc.

    Can you please guide me how to write this, as I try to declare one more filed in random read write sequences as FFFFFFFFF data, but it,s not working.

    Please post me this sequence so that can move forward

    I am doing something like this

    for each (r) in reglist{

    do op keeping {

    .static_item=r;

    .direction == write;

    };

    in the above code , have no idea how to add data field as 0xFFFFFFFFFF and 0X0000000000; 

    Thanks 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ukashkartim
    ukashkartim over 11 years ago
    hello 
     
    I'm looking for a long time this utility 
    You've helped me a lot..
     
    Thank you very much...
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • kumral
    kumral over 11 years ago
    hi; great utility for my project thanks alot to share
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • vgurpreet
    vgurpreet over 9 years ago
    Useful code.This is very helpful for me. Thank you. http://amansharma.in
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Lorean
    Lorean over 8 years ago

    Thanks! this was usefull for me too. Im working hard on something that envolves all that you explained. It was costing me alot of time and effort... so thanks !!!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
<

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information