traffic light controller

D

Dan

Hi,

I'm synthesizing a traffic light controller in VHDL and right now I use

001 -> Red
010 -> Yellow
100 -> Green

When I simulate the design in ModelSIM, I would like to show the word "Red"
instead of "001" and so on. How is this possible?

Thanks
 
D

Darol Klawetter

Hi,

I'm synthesizing a traffic light controller in VHDL and right now I use

001 -> Red
010 -> Yellow
100 -> Green

When I simulate the design in ModelSIM, I would like to show the word "Red"
instead of "001" and so on. How is this possible?

Thanks

ModelSim will show the state-machine state names if you select the
correct display format option. I would look it up for you, but I don't
have ModelSIM with me right now. In your VHDL, use the "constant"
keyword to associate 001 with "Red", etc.
 
K

KJ

Dan said:
Hi,

I'm synthesizing a traffic light controller in VHDL and right now I use

001 -> Red
010 -> Yellow
100 -> Green

When I simulate the design in ModelSIM, I would like to show the word
"Red" instead of "001" and so on. How is this possible?

Thanks

Define a new type that has the list of enumerations (i.e. list of light
colors). Below is sample code that
- Defines such a type
- Declares a signal of that type
- Sets the value of that signal to be 'Red'.

Modelsim will display the signal as 'Red'.

architecture RTL of Whatever is
type t_TRAFFIC_LIGHT is (Red, Yellow, Green);
signal Current_Light_Color: t_TRAFFIC_LIGHT;
begin
Current_Light_Color <= Red;
end RTL;

KJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top