Test process behaviour

Discussion in 'VHDL' started by Peter, Feb 9, 2012.

  1. Peter

    Peter Guest

    Hi,

    I have used VHDL for some years but still get confused sometimes...

    I have a testbench with a process calling a number of procedures. Each
    procedure represents a test case. One procedure is supposed to inject
    a fault by forcing a line low to see if fault flags are set in the
    design. The problem is that this procedure mess up all remaining test
    even if it is not called from the main process!? The SCL line goes U
    when the bus_error_test1 is declared. But not called....

    procedure bus_error_test1 is
    begin
    scl <= '0'; -- Fault injection
    Write(SLVADR,"00011011");
    .....
    end bus_error_test1;
    ....

    begin -- Start of main process

    Reset;
    check_default_reg; -- A number of different tests
    ram_test;
    ic_tx1; -- All of them report errors because of
    the not called procedure
    ......

    ic_rxtx3;
    ic_rx;
    --bus_error_test1; -- Procedure made as comment, but still
    mess up remaining tests

    I am sure You VHDL gurus can explain this behaviour. Its like a
    software subroutine that executes despite its not called?? :)

    Regards Peter
    Peter, Feb 9, 2012
    #1
    1. Advertising

  2. On Thu, 09 Feb 2012 01:53:08 -0800, Peter wrote:

    > Hi,
    >
    > I have used VHDL for some years but still get confused sometimes...
    >
    > I have a testbench with a process calling a number of procedures. Each
    > procedure represents a test case. One procedure is supposed to inject a
    > fault by forcing a line low to see if fault flags are set in the design.
    > The problem is that this procedure mess up all remaining test even if it
    > is not called from the main process!? The SCL line goes U when the
    > bus_error_test1 is declared. But not called....
    >
    > procedure bus_error_test1 is begin scl <= '0';
    > -- Fault injection Write(SLVADR,"00011011");
    > ....
    > end bus_error_test1;
    > ...
    >
    > begin -- Start of main process
    >
    > Reset;
    > check_default_reg; -- A number of different tests ram_test;
    > ic_tx1; -- All of them report errors because of
    > the not called procedure .....
    >
    > ic_rxtx3;
    > ic_rx;
    > --bus_error_test1; -- Procedure made as comment, but still mess
    > up remaining tests
    >
    > I am sure You VHDL gurus can explain this behaviour. Its like a software
    > subroutine that executes despite its not called?? :)



    The process has a driver for that signal if any of its procedures makes
    an assignment to the signal. The process drives the leftmost value,
    which is 'U', until another value is given, but since you never call the
    procedure that gives it a value, it stays at 'U'.

    Fix: put an assignment in at the first line of the process:

    SCL <= 'Z';

    Regards,
    Allan
    Allan Herriman, Feb 9, 2012
    #2
    1. Advertising

  3. Peter

    Peter Guest

    On 9 Feb, 11:36, Allan Herriman <> wrote:
    > On Thu, 09 Feb 2012 01:53:08 -0800, Peter wrote:
    > > Hi,

    >
    > > I have used VHDL for some years but still get confused sometimes...

    >
    > > I have a testbench with a process calling a number of procedures. Each
    > > procedure represents a test case. One procedure is supposed to inject a
    > > fault by forcing a line low to see if fault flags are set in the design..
    > > The problem is that this procedure mess up all remaining test even if it
    > > is not called from the main process!? The SCL line goes U when the
    > > bus_error_test1 is declared. But not called....

    >
    > > procedure bus_error_test1 is begin scl <= '0';
    > >             -- Fault injection Write(SLVADR,"00011011");
    > > ....
    > > end bus_error_test1;
    > > ...

    >
    > > begin -- Start of main process

    >
    > > Reset;
    > > check_default_reg;       -- A number of different tests ram_test;
    > > ic_tx1;                        -- All of them report errors because of
    > > the not called procedure .....

    >
    > > ic_rxtx3;
    > > ic_rx;
    > > --bus_error_test1;         -- Procedure made as comment, but still mess
    > > up remaining tests

    >
    > > I am sure You VHDL gurus can explain this behaviour. Its like a software
    > > subroutine that executes despite its not called?? :)

    >
    > The process has a driver for that signal if any of its procedures makes
    > an assignment to the signal.  The process drives the leftmost value,
    > which is 'U', until another value is given, but since you never call the
    > procedure that gives it a value, it stays at 'U'.
    >
    > Fix: put an assignment in at the first line of the process:
    >
    > SCL <= 'Z';
    >
    > Regards,
    > Allan- Dölj citerad text -
    >
    > - Visa citerad text -


    Clever...

    Thanks a lot!

    Regards Peter
    Peter, Feb 9, 2012
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    787
  2. Andy Chambers
    Replies:
    1
    Views:
    374
    Daniel Dyer
    May 14, 2007
  3. Skybuck Flying

    Call oddities: &Test() vs &Test vs Test

    Skybuck Flying, Oct 4, 2009, in forum: C Programming
    Replies:
    1
    Views:
    680
    Skybuck Flying
    Oct 4, 2009
  4. Replies:
    2
    Views:
    99
  5. Marcin Szewczyk
    Replies:
    0
    Views:
    87
    Marcin Szewczyk
    Jan 18, 2013
Loading...

Share This Page