- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i want to know the meaning of this instruction?what does it return?
return type_dwt_ctrl_signal(to_unsigned(type_dwt_ctrl_signal_enum'pos(x), cst_dwt_ctrl_sig_bus_width));:confused::confused::confused:Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
'pos(x) returns an integer which is the position of x in the enumeration type of TYPE_DWT_CTRL_SIG NAL_ENUM. (as ax example if TYPE_DWT_CTRL_SIG NAL_ENUM is (yes,no,maybe) then TYPE_DWT_CTRL_SIG NAL_ENUM'POS(no) is 1).
to_unsigned() converts that integer to a bit vector using an unsigned format, with CST_DWT_CTRL_SIG_BUS_WIDTH bits. The resulting vector is sent to the TYPE_DWT_CTRL_SIGNAL. Please note that that kind of code should only be used for simulation. Using 'POS on enum types is unreliable with synthesis (if supported by the synthesizer).
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