problem with modelsim

Discussion in 'VHDL' started by Torsten Bitterlich, Aug 3, 2003.

  1. Hi there,

    I am experiencing a problem when using Modelsim. The following piece of
    code is to be simulated :

    variable t1,t2 : time;
    variable temp1, temp2 : real;
    variable cp : real := (1.0/(500 * 1000000.0));


    temp1 := cell_ptr.t1(x+y-1);
    temp2 := cell_ptr.t2(x+y-1);

    t1 := (temp1 * cp) * 1 sec;
    t2 := (cp - (temp2 * cp)) * 1 sec;

    The variable temp1 for example has the value 0.10991, temp2 is 0.877552.
    Cp is as expected 2e-9. The problem occurs with t1 and t2. These
    calculations result in 0. When simulating this code with Aldec Riviera,
    the variables are correctly calculated. Is there something to be done in
    Modelsim, maybe concerning the time resolution, so this works? Im using
    Modelsim XE/Starter 5.6a, the free Xilinx edition. Thanks for any help,

    Regards,

    Torsten
    Torsten Bitterlich, Aug 3, 2003
    #1
    1. Advertising

  2. Although not familair with the details of "Modelsim XE/Starter". You can
    normally set
    a resolution in ModelSim add the moment you load a design using the
    graphical environment
    or if you type the vsim command, something like: vsim -t fs <your design>
    should work

    Egbert Molenkamp

    "Torsten Bitterlich" <> schreef in bericht
    news:bgir2o$p1gml$-berlin.de...
    > Hi there,
    >
    > I am experiencing a problem when using Modelsim. The following piece of
    > code is to be simulated :
    >
    > variable t1,t2 : time;
    > variable temp1, temp2 : real;
    > variable cp : real := (1.0/(500 * 1000000.0));
    >
    >
    > temp1 := cell_ptr.t1(x+y-1);
    > temp2 := cell_ptr.t2(x+y-1);
    >
    > t1 := (temp1 * cp) * 1 sec;
    > t2 := (cp - (temp2 * cp)) * 1 sec;
    >
    > The variable temp1 for example has the value 0.10991, temp2 is 0.877552.
    > Cp is as expected 2e-9. The problem occurs with t1 and t2. These
    > calculations result in 0. When simulating this code with Aldec Riviera,
    > the variables are correctly calculated. Is there something to be done in
    > Modelsim, maybe concerning the time resolution, so this works? Im using
    > Modelsim XE/Starter 5.6a, the free Xilinx edition. Thanks for any help,
    >
    > Regards,
    >
    > Torsten
    >
    Egbert Molenkamp, Aug 4, 2003
    #2
    1. Advertising

  3. Hi,
    Modelsim XE/Starter does support that option and Egbert is correct in his
    observation, it is your time resolution that has truncated t1 & t2. Here is
    the sample output from MXE/Starter:

    # ** Note: temp1 1.099100e-001 temp2 8.775520e-001 t1 220 ps t2 245 ps cp
    2.000000e-009

    ^^^^^^^^^^^^^^
    If I run with -t ns

    $ vsim -c time_e -t ns -do "run"
    # ** Note: temp1 1.099100e-001 temp2 8.775520e-001 t1 0 ns t2 0 ns cp
    2.000000e-009

    ^^^^^^^^^^^^
    Srinivasan
    --
    Srinivasan Venkataramanan
    Senior Verification Engineer
    Software & Silicon Systems India Pvt Ltd. - an Intel company
    Bangalore, India

    http://www.noveldv.com http://www.deeps.org

    I don't speak for Intel
    "Egbert Molenkamp" <> wrote in message
    news:bgljf0$2hv$...
    > Although not familair with the details of "Modelsim XE/Starter". You can
    > normally set
    > a resolution in ModelSim add the moment you load a design using the
    > graphical environment
    > or if you type the vsim command, something like: vsim -t fs <your design>
    > should work
    >
    > Egbert Molenkamp
    >
    > "Torsten Bitterlich" <> schreef in bericht
    > news:bgir2o$p1gml$-berlin.de...
    > > Hi there,
    > >
    > > I am experiencing a problem when using Modelsim. The following piece of
    > > code is to be simulated :
    > >
    > > variable t1,t2 : time;
    > > variable temp1, temp2 : real;
    > > variable cp : real := (1.0/(500 * 1000000.0));
    > >
    > >
    > > temp1 := cell_ptr.t1(x+y-1);
    > > temp2 := cell_ptr.t2(x+y-1);
    > >
    > > t1 := (temp1 * cp) * 1 sec;
    > > t2 := (cp - (temp2 * cp)) * 1 sec;
    > >
    > > The variable temp1 for example has the value 0.10991, temp2 is 0.877552.
    > > Cp is as expected 2e-9. The problem occurs with t1 and t2. These
    > > calculations result in 0. When simulating this code with Aldec Riviera,
    > > the variables are correctly calculated. Is there something to be done in
    > > Modelsim, maybe concerning the time resolution, so this works? Im using
    > > Modelsim XE/Starter 5.6a, the free Xilinx edition. Thanks for any help,
    > >
    > > Regards,
    > >
    > > Torsten
    > >

    >
    >
    Srinivasan Venkataramanan, Aug 5, 2003
    #3
  4. Torsten Bitterlich

    agustinmarquez

    Joined:
    Apr 24, 2008
    Messages:
    1
    hello, for me the problem is that the modelsim starter is limited for simulated some programs. do you check it?

    bye

    QUOTE=Torsten Bitterlich]Hi there,

    I am experiencing a problem when using Modelsim. The following piece of
    code is to be simulated :

    variable t1,t2 : time;
    variable temp1, temp2 : real;
    variable cp : real := (1.0/(500 * 1000000.0));


    temp1 := cell_ptr.t1(x+y-1);
    temp2 := cell_ptr.t2(x+y-1);

    t1 := (temp1 * cp) * 1 sec;
    t2 := (cp - (temp2 * cp)) * 1 sec;

    The variable temp1 for example has the value 0.10991, temp2 is 0.877552.
    Cp is as expected 2e-9. The problem occurs with t1 and t2. These
    calculations result in 0. When simulating this code with Aldec Riviera,
    the variables are correctly calculated. Is there something to be done in
    Modelsim, maybe concerning the time resolution, so this works? Im using
    Modelsim XE/Starter 5.6a, the free Xilinx edition. Thanks for any help,

    Regards,

    Torsten[/QUOTE]
    agustinmarquez, Apr 24, 2008
    #4
    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. Thomas

    Yet another modelsim problem

    Thomas, Aug 12, 2003, in forum: VHDL
    Replies:
    1
    Views:
    1,310
    K Mussatt
    Aug 14, 2003
  2. Debashish
    Replies:
    3
    Views:
    3,305
    Prasanna
    Aug 19, 2003
  3. Andreas

    Modelsim compile problem

    Andreas, Feb 5, 2004, in forum: VHDL
    Replies:
    1
    Views:
    3,833
  4. Jeremy Webb
    Replies:
    2
    Views:
    2,755
    Jeremy Webb
    Oct 23, 2004
  5. anil
    Replies:
    0
    Views:
    470
Loading...

Share This Page