Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
10 years ago

Unable to simulate ALTSQRT in ModelSim Altera

I wrote a small program to try out the altera sqrt ip. i included the module in a quick script i wrote, but when i try to simulate it, i get X values in some of the bit fields. I thought it might be a latency thing, but i've let the simualtion run for 100 cycles and the result stays the same. Is there something more I should be doing to simulate ALTSQRT correctly?

http://www.alteraforum.com/forum/attachment.php?attachmentid=10821&stc=1

7 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Does these X bits required initialization? Or they are output? Seems like these bits remain undefined throughout the simulation.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Those are the output. As you can see until i write data to them, the output stays 0 and then some bits go to X. I think the X in modelsim is when a line is driven by multiple inputs. but i dont know why that happens for an altera IP block!

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Karthik,

    In a simulation when the X comes out from an IP block is when the IP cannot determined whether the output should be '0' or '1'. From the pic it seems your reset was not defined after the second clk cycle. Of course the output would be 'X'
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Hi Karthik,

    In a simulation when the X comes out from an IP block is when the IP cannot determined whether the output should be '0' or '1'. From the pic it seems your reset was not defined after the second clk cycle. Of course the output would be 'X'

    --- Quote End ---

    Hi, I tried that but didnt seem to change the result. its still driving the same output. The reset I've shown here is only for my logic which drives the input to the design. i dont even have any code that checks for that reset! also the reset itself isnt connected to the sqrt block.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Review the modelsim log messages and pay particular attention to uninitialized or unconnected items.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The output signals at X mean you have something else in your testbench driving it to '0'. It's causing a conflict when the SqRT function is trying to drive a '1' - hence the 'X' ('0' drives '0' to '0')