- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm trying to define a custom radix in the wave.do file for a single signal of type std_logic. However, this definition doesn't seem to be recognized by modelsim: the signal is always displayed with a numeric value. Does anyone have any idea why ? clock.vhd --------- ... constant cAM : std_logic := '0'; constant cPM : std_logic := '1'; signal ampm : std_logic; ... ampm <= cAM; ... ampm <= cPM; ... wave.do ------- radix define radix_ampm { "1'b0" "AM" -color "white", "1'b1" "PM" -color "white", -default hexadecimal } add wave -noupdate -radix radix_ampm /tb/clock/ampm Thanks for your help, P9Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If I create a dummy signal of type std_logic_vector(0 downto 0) and assign ampm to it, I can see the right radix in modelsim. However, I'd like to avoid this kind of hack.
signal dbg_ampm : std_logic_vector(0 downto 0); dbg_ampm(0) <= ampm; add wave -noupdate -radix radix_ampm /tb/clock/dbg_ampm- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can only guess it is because std_logic is such a basic type, and it is also not an array type.
you may have a few workarounds. define your own am/pm type: type ampm_t is (am, pm); signal ampm : ampm_t; or use a boolean signal isam : boolean;- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For sure, if ampm is an isolated signal, this is definitely the way to go as the meaning of the signal is then unambiguous when reading the code.
For what concerns the boolean, I'm afraid that true/false is not much more readable than '1'/'0' for what concerns an AM/PM indicator. However... what if it is an alias to a bit of a larger register ? -> Don't think it is possible. what if it is a port signal ? -> Would require the use of a package. all these what clauses require additional complexity just to overcome the lack of support of the radix for std_logic in modelsim. Then my dummy signal trick has the same effort penalty, if not less. Thanks anyways for the suggestions.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page