• 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
  3. struck in arithmetic

Stats

  • Locked Locked
  • Replies 9
  • Subscribers 64
  • Views 15999
  • 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

struck in arithmetic

archive
archive over 17 years ago

Hi Friends,
 I couldn't debug this error  while I"m working on UVC using SVCB. Can anyone help me in this regards?

   =>   j = j + 1;
    ncvlog *E BADCON:  Illegal Concatenation Syntax
Below is the rough sketch of the code:

     class my_class extends urm_bfm;
           .........
           int j;
           task my_task;
                  .........
                  j = j + 1;
            endtask
           ...........
     endclass
      
Thanks in advance,
Regards,
Jalli


Originally posted in cdnusers.org by jaally
  • Cancel
  • archive
    archive over 17 years ago

    Hi Jalli.

    The error suggests you've got some code with an open bracket "{" and no matching closing bracket "}".
    Maybe there is a problem with the way you call one of the URM macros?
    A problem there could flow through to appear on a following line.

    So check your urm calls, and if you can't fix it, can you paste the whole task body for us to review?
    If it's too sensitive to put in the forum, you could submit a service request via SourceLink or support@cadence.com.

    Cheers.


    Originally posted in cdnusers.org by stephenh
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    Hi Steve,
    I think my macros and even the braces are perfectly alright!. Just inclusion of the following task is generating the error:
    Lemme know what is the mistake in this code!


    task drive_channel_phase();
    vif.burstmax <= BurstMax;
    foreach(ch_buff[i]){

    channel_counter = channel_counter + 1;
    channel_id = channel_counter;
    channel_data_size = ch_buff[i].payload.size();
    ch_buff.count1 = BurstMax;
    print BurstMax;

    if(ch_buff[i].payload.size() % BurstMax == 0){
    no_bursts1 = (ch_buff[i].payload.size()/BurstMax);
    }else{
    no_bursts1 = (ch_buff[i].payload.size()/BurstMax) + 1;
    }

    if(no_bursts >= no_bursts1) {
    no_bursts = no_bursts;
    }else {
    no_bursts = no_bursts1;
    }

    ch_buff[i].no_bursts = no_bursts;
    }
    endtask

    Thanks in Advance,
    Regards,
    Jalli


    Originally posted in cdnusers.org by jaally
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    I think (but have not tested) your problem is the "{" and "}" on the foreach statements.
    Try this instead:
    task drive_channel_phase(); vif.burstmax <= BurstMax; foreach(ch_buff[i]) begin channel_counter = channel_counter + 1; channel_id = channel_counter; channel_data_size = ch_buff[i].payload.size(); ch_buff.count1 = BurstMax; print BurstMax; if(ch_buff[i].payload.size() % BurstMax == 0) begin no_bursts1 = (ch_buff[i].payload.size()/BurstMax); end else begin no_bursts1 = (ch_buff[i].payload.size()/BurstMax) + 1; end if(no_bursts >= no_bursts1) begin no_bursts = no_bursts; end else begin no_bursts = no_bursts1; end ch_buff[i].no_bursts = no_bursts; end endtask I know SystemVerilog has some similarities with C, but you do need to use begin/end rather than "{}"! :-)


    Originally posted in cdnusers.org by stephenh
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    Hi Steve,

    Thanks a lot! It did solve the problem but I don't understand why the error reports are not clear to mention of what was the exact error or to be specific atleast which line we need to look to debug?
    Do U've any doc which explains all these errors in detail and any such template.??

    Best Regards,
    Jalli


    Originally posted in cdnusers.org by jaally
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    Hi Jalli. I'm glad it solved your problem :-)

    I think the compiler did a reasonable job of pointing you to the problem, because it reported "illegal concatenation syntax" on the first line after the opening bracket.
    In Verilog (and SystemVerilog), the curly brackets are used to define concatenation, e.g:
    assign some_2_bit_sig = { 1'b1, a_1_bit_sig };

    So the compiler saw an opening bracket, followed by some procedural code which did not fit the expected pattern.
    It's often the case for compilers (in any language) to flag an error on some line after the actual problem, simply because of the way compilers have to work.

    Hope this helps.


    Originally posted in cdnusers.org by stephenh
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    I nearly forgot to mention - you should always use "nchelp" as your first step in diagnosing a problem.
    In the case of your error message:
    "ncvlog *E BADCON: Illegal Concatenation Syntax"

    Try the command: "nchelp ncvlog BADCON"
    This reports some more information:

    nchelp: 06.20-s003: (c) Copyright 1995-2007 Cadence Design Systems, Inc.
    ncvlog/BADCON =
    A poorly formed concatenation was found. The syntax error is
    within the body of the concatenation.

    From there you could look in the SystemVerilog LRM, or you training materials, book etc, to see what a concatenation operator is, and find the issue that way.


    Originally posted in cdnusers.org by stephenh
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    Lol!!...That's true Steve that I made a mistake in finding out the exact mistake of concatenation but what I was talking was in general.
    Like for example, most of the time we get "NULL pointer dereference" error which doesn't point out the exact syntax error!
    which when traced we find that the error is something else!
    Anyway, Thanks once again...I do refer to ieee lrm of SV and other stuff including the nchelp.
    Regards,
    Jalli


    Originally posted in cdnusers.org by jaally
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    Hmmm... Is that "NULL pointer dereference" coming from the compiler or the simulator?
    I would expect that if you accidentally try to do an operation on a class object that isn't new'd, which can be pretty tough to track down. But if the error is coming out of the compiler or elaborator, then it would help if you could file a service request so we can track down the problem.

    Thanks.


    Originally posted in cdnusers.org by stephenh
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    Hi Steve,
    You are right!....I'll try to file the same from now on!
    Thanks & Regards,
    Jalli


    Originally posted in cdnusers.org by jaally
    • 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