Forum Discussion

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

Weirdest thing - MAX3000A simulation

I think I'm going crazy... I created a simple project for MAX3000A (schematic file, part of the schematic is attached) and tried to simulate in ModelSim - SE.

https://www.alteraforum.com/forum/attachment.php?attachmentid=8560

What I got I can't explain at all - the counter counts without any reason ! It's clearly visible on the attached wave picture - signal 53 goes to '1' before 53clk changes !

https://www.alteraforum.com/forum/attachment.php?attachmentid=8561

Any ideas ?

Thank you in advance !

17 Replies

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

    Looked at the gate level design more carefully - the explanation does not look so simple... Even if we assume the counter DD3-3 is clocked by wrong edge of the clock (being connected directly to p41 instead of clk53), this does not explain why the counter DOES count with ANY input...

    And I think the gate level netlist is correct - p41 signal being inverted inside of lpm_counter2 and does not require separate invertor inst12... Of course, I can be wrong...
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I didn't say that the counter is controlled by a wrong edge, just with less propagatipn delay. And I don't see the counter counting without input edge. I'm not sure if you are looking at the right signals.

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

    I think it's very clearly visible in the simulation window - signal 53 switches to '1' before anything happens with the clock signal - 53clk, am I wrong ???

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

    I don't see it my simulation. Isn't it a different circuit? There's no signal "53" in the present design.

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

    Because I discovered that HDLs don't like wire names starting with numbers, I added "p" letter in a front of all signals (and renamed 53clk to clk53 etc).

    After I did these changes I checked - nothing changed in the simulation. Also I checked with older Quartus 9.0 - the same... Can attach the simulation with new names, but a bit later - away from my computer now (and again - it's absolutely identical to the simulation I already attached - except a slight change in signal names)...
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I think the reason of the strange (as I thought before) behavior is very simple - I don't set initial values of the counters, and they are behaving differently for different CPLD families. After I added initial reset, everything started working in the expected way.

    Yes - I need to learn a lot of things...