+ Post New Thread
Results 1 to 8 of 8
  1. #1
    Newbie level 3
    Points: 26, Level: 1

    Join Date
    Jun 2017
    Posts
    3
    Helped
    0 / 0
    Points
    26
    Level
    1

    simulation-based faults injection

    Hello,

    Can you help me to find a method to inject faults one after the other in a DUT using modelsim's command in a verilog testbench?

    I will be very grateful.

    •   Alt12th June 2017, 11:23

      advertising

        
       

  2. #2
    Advanced Member level 4
    Points: 5,006, Level: 16

    Join Date
    Apr 2016
    Posts
    1,055
    Helped
    188 / 188
    Points
    5,006
    Level
    16

    Re: simulation-based faults injection

    modelsim has support for it's own force command, and verilog also has a $force task. You can use either one. Very simple to use.
    Really, I am not Sam.



    •   Alt12th June 2017, 21:04

      advertising

        
       

  3. #3
    Newbie level 3
    Points: 26, Level: 1

    Join Date
    Jun 2017
    Posts
    3
    Helped
    0 / 0
    Points
    26
    Level
    1

    Re: simulation-based faults injection

    Quote Originally Posted by ThisIsNotSam View Post
    modelsim has support for it's own force command, and verilog also has a $force task. You can use either one. Very simple to use.
    Thank you for your answer but I can't figure out how to use this commands (I'm a beginner).Can you help me please?



    •   Alt13th June 2017, 14:21

      advertising

        
       

  4. #4
    Advanced Member level 4
    Points: 5,006, Level: 16

    Join Date
    Apr 2016
    Posts
    1,055
    Helped
    188 / 188
    Points
    5,006
    Level
    16

    Re: simulation-based faults injection

    Quote Originally Posted by ouij View Post
    Thank you for your answer but I can't figure out how to use this commands (I'm a beginner).Can you help me please?
    Have you googled it? Have you checked the documentation? These commands are extremely easy to use. You pick the node to which you want to inject a fault, and you set it's new value. It's not rocket science.
    Really, I am not Sam.



  5. #5
    Advanced Member level 3
    Points: 5,807, Level: 18

    Join Date
    Dec 2011
    Location
    Fremont, CA, USA
    Posts
    727
    Helped
    332 / 332
    Points
    5,807
    Level
    18
    Blog Entries
    4

    Re: simulation-based faults injection

    It would help if you explain what you mean by "to inject faults in a DUT". This could have many different meanings.
    Dave Rich
    Senior Verification Consultant
    Mentor Graphics Corporation



  6. #6
    Advanced Member level 4
    Points: 5,006, Level: 16

    Join Date
    Apr 2016
    Posts
    1,055
    Helped
    188 / 188
    Points
    5,006
    Level
    16

    Re: simulation-based faults injection

    Quote Originally Posted by dave_59 View Post
    It would help if you explain what you mean by "to inject faults in a DUT". This could have many different meanings.
    it has different meanings, but regardless of the purpose, the process is the same. just use the force command to make a signal switch from something to something else.
    Really, I am not Sam.



  7. #7
    Newbie level 3
    Points: 26, Level: 1

    Join Date
    Jun 2017
    Posts
    3
    Helped
    0 / 0
    Points
    26
    Level
    1

    Re: simulation-based faults injection

    In fact i want to inject faults in a DUT which means Device Under Test,I created a text file where i have the name of signal that i want to force and the fault type,so now i'm looking for reading a file containing the following : b05_test.dut.n509 0

    I'm blocked at the fgets instruction because it doesn't zork this way: scan_faults = $fgets(file_faults , string , data);

    Any help please?



    •   Alt15th June 2017, 09:24

      advertising

        
       

  8. #8
    Super Moderator
    Points: 27,795, Level: 40
    ads-ee's Avatar
    Join Date
    Sep 2013
    Location
    USA
    Posts
    6,351
    Helped
    1538 / 1538
    Points
    27,795
    Level
    40

    Re: simulation-based faults injection

    Quote Originally Posted by ouij View Post
    In fact i want to inject faults in a DUT which means Device Under Test,I created a text file where i have the name of signal that i want to force and the fault type,so now i'm looking for reading a file containing the following : b05_test.dut.n509 0

    I'm blocked at the fgets instruction because it doesn't zork this way: scan_faults = $fgets(file_faults , string , data);

    Any help please?
    What do you mean by $fgets doesn't work this way? $fgets works the way it is defined to work. Maybe you should have stated HOW you want it to work and if there is something else besides $fgets that DOES work the way you want.

    As it is hard to follow what you are asking perhaps $fscanf will work better for you. It uses a format string to load reg variables, which you can then use $force to apply them to those internal DUT nodes.

    Unless you can be very clear on what you are trying to do and what the problem is with the current method it is very difficult to help you, i.e. good questions get good answers, bad questions get a lot of questions about your question.



--[[ ]]--