• 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. String concatenation

Stats

  • Locked Locked
  • Replies 7
  • Subscribers 66
  • Views 20256
  • 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

String concatenation

SpecMAN INFANT
SpecMAN INFANT over 16 years ago

Hi,

My requirement is to create a list of names err_00_count; err_01_count and so on till err_99_count. In order to achieve this I used the append operator  as append("err_",x,"_count"). where x was a loop variable. But the result comes out as  err_0x<actual no.>_count. Is there any way in which the 0x can be eliminated?

 

 

  • Cancel
Parents
  • StephenH
    StephenH over 16 years ago

    Please don't keep saying it's not possible, you just need to understand what the C printf() format string means.
    A quick Google search or looking at a C text book will tell you all you need.

    In order to help you, I have written a small demo. Here is the Specman code:

    $ cat print_demo.e
    <'
    extend sys {
      run() is also {
        for x from 0 to 5 {
          out( appendf("err_%02d_count", x) );
        };
      };
    };
    '>

    And here is the output from the demo code:

    $ specman -c "load print_demo ; test"
    Welcome to Specman Elite (08.20.003-s)  -  Linked on Thu Mar  5 17:31:56 2009

    Protected by U.S. Patents 6,141,630 ;6,182,258; 6,219,809; 6,347,388;
    6,487,704; 6,499,132; 6,502,232; 6,519,727; 6,530,054; 6,675,138; 6,684,359;
    6,687,662; 6,907,599; 6,918,076; 6,920,583; Other Patents Pending.

    Checking license ... OK
    Loading print_demo.e ...
    read...parse...update...patch...h code...code...clean...
    Doing setup ...
    Generating the test using seed 1...

    Starting the test ...
    Running the test ...
    err_00_count
    err_01_count
    err_02_count
    err_03_count
    err_04_count
    err_05_count
    No actual running requested.
    Checking the test ...
    Checking is complete - 0 DUT errors, 0 DUT warnings.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • StephenH
    StephenH over 16 years ago

    Please don't keep saying it's not possible, you just need to understand what the C printf() format string means.
    A quick Google search or looking at a C text book will tell you all you need.

    In order to help you, I have written a small demo. Here is the Specman code:

    $ cat print_demo.e
    <'
    extend sys {
      run() is also {
        for x from 0 to 5 {
          out( appendf("err_%02d_count", x) );
        };
      };
    };
    '>

    And here is the output from the demo code:

    $ specman -c "load print_demo ; test"
    Welcome to Specman Elite (08.20.003-s)  -  Linked on Thu Mar  5 17:31:56 2009

    Protected by U.S. Patents 6,141,630 ;6,182,258; 6,219,809; 6,347,388;
    6,487,704; 6,499,132; 6,502,232; 6,519,727; 6,530,054; 6,675,138; 6,684,359;
    6,687,662; 6,907,599; 6,918,076; 6,920,583; Other Patents Pending.

    Checking license ... OK
    Loading print_demo.e ...
    read...parse...update...patch...h code...code...clean...
    Doing setup ...
    Generating the test using seed 1...

    Starting the test ...
    Running the test ...
    err_00_count
    err_01_count
    err_02_count
    err_03_count
    err_04_count
    err_05_count
    No actual running requested.
    Checking the test ...
    Checking is complete - 0 DUT errors, 0 DUT warnings.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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