- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Hello. I am new in VHDL. I try to create train ticket machine using vhdl. It have 3 destination and all destination have fee. When user insert money with same of fee, ticket will out and no change but if user enter extra money than fee, ticket will out also with change.When i run the simulation all output does not appear. Anybody can help me with my code below,please. Thanks. God bless you.
- Balises:
- Intel® Quartus® Prime Software
Lien copié
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Are you simulating with Model-Sim? If yes, when you start it probably you see that it hangs. What really happens is that your testbench doesn't have a stop condition, so simulation never ends:
--- Quote Start --- wait; end process; END; --- Quote End --- If yes, you may click the STOP button or replace the last lines of testbench with assert falsereport "simulation completed"
severity failure;
end process;
end;
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
You're using ISE/ISim. This is an Altera Forum.
There is something strange in your code. You control output like Retrn inside clk'event if. So Retrn is registered. But when you detect reset condition, you assign a reset value only to "Train_state". The simulator show cleary that some signals have and undefined state ( UUUU ).- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Thanks. But i still dont get it. can u show me which code that wrong and what the exactly code that i need change it.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
As I said, assign a value to the output vectors on reset conditions. I do it and Retrn vector gets a defined value. With "money_sum" vector the problem in different. You forgot this signal in the component instantiation in the testbench ( look at the original code ). When you add it, money_sum gets a defined value too.
Because some reason you declare money_sum as inout, so i place the reset value as Hi-Z ( "ZZZZ" ). Check what is the right value on this situation. I post the corrected codes.- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Can you explain in more detail how should work this circuit? I will help you better.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Ok. For example output that I want, if kl_station=1 which the fees for kl ticket is greater than 2.When RM1 insert, Money_sum<="0001",when RM2 insert,Money_sum<="0011" because RM1 + RM2. Then, ticket will be 1 and change must equal to "0001". I hope you understand what I mean.Thanks
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
I don't undestand very well, but it will useful to add the state register to the waveforms. Money_sum is "0001" the after 1 clock cycle RM1 goes '1'. Probably you inferred a register for money_sum but its next state logic isn't clear in your code.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
It ok. Thanks for response. I already done it.

- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable