Home > Community > Forums > Functional Verification > help with e *** Error: list is empty - cannot access item 0

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: *

 help with e *** Error: list is empty - cannot access item 0 

Last post Tue, Aug 31 2010 1:44 AM by StephenH. 1 replies.
Started by JAbusaid 19 Aug 2010 04:10 PM. Topic has 1 replies and 1607 views
Page 1 of 1 (2 items)
Sort Posts:
  • Thu, Aug 19 2010 4:10 PM

    • JAbusaid
    • Not Ranked
    • Joined on Thu, Aug 19 2010
    • Posts 1
    • Points 20
    help with e *** Error: list is empty - cannot access item 0 Reply

    I have the following structure:

    struct collector_txn_s like any_sequence_item {
        kind : trans_kind_t;
        keep soft kind == GENERIC;
        %data    : list of byte;
    ........................
    };

    When I do the following:

        private send_odt()is {

          transfer = new GENERIC collector_txn_s with{
           for each (d) using index (byte_idx) in smp.D_sig_l {
            it.data[byte_idx] = d.get();
           };

    I get the  Error: list is empty - cannot access item 0 error.

     

    Any ideas why this might be happening?

    Filed under:
    • Post Points: 20
  • Tue, Aug 31 2010 1:44 AM

    • StephenH
    • Top 25 Contributor
    • Joined on Tue, Sep 2 2008
    • Bristol, Avon
    • Posts 278
    • Points 4,450
    Re: help with e *** Error: list is empty - cannot access item 0 Reply

    Have you tried stepping through the code in the debugger, to see which line triggers the error?

    You might need to set the list size, because you're using a "new" action here, not a "gen" action. Whilst "gen" will allocate randomly all the lists, I believe "new" will not allocate anything that you have not explicitly asked it to do. In effect the code in the "with" block is just the same as putting it all as procedural code, thus:

    transfer = new GENERIC collector_txn_s;
    for each (d) using index ... { ... };

     

    Steve Hobbs / Applications Engineer / Cadence Functional Verification
    Filed under:
    • Post Points: 5
Page 1 of 1 (2 items)
Sort Posts:
Started by JAbusaid at 19 Aug 2010 04:10 PM. Topic has 1 replies.