- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 ).- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you explain in more detail how should work this circuit? I will help you better.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It ok. Thanks for response. I already done it.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page