Fix enum compile warnings and update ivl.def (windows compile).

This patch fixes a few compilation warnings introduced by the
enumeration code. It also updates the ivl.def file so that the
proper routines get exported under windows.
This commit is contained in:
Cary R 2010-11-29 11:23:00 -08:00 committed by Stephen Williams
parent 16e1570737
commit d0b063b4a4
5 changed files with 18 additions and 2 deletions

View File

@ -26,6 +26,12 @@ ivl_discipline_flow
ivl_discipline_name
ivl_discipline_potential
ivl_enum_name
ivl_enum_names
ivl_enum_bits
ivl_enum_type
ivl_enum_width
ivl_event_any
ivl_event_basename
ivl_event_name
@ -42,6 +48,7 @@ ivl_expr_branch
ivl_expr_def
ivl_expr_delay_val
ivl_expr_dvalue
ivl_expr_enumtype
ivl_expr_event
ivl_expr_file
ivl_expr_lineno
@ -161,6 +168,8 @@ ivl_scope_children
ivl_scope_def
ivl_scope_def_file
ivl_scope_def_lineno
ivl_scope_enumerate
ivl_scope_enumerates
ivl_scope_event
ivl_scope_events
ivl_scope_file

View File

@ -36,7 +36,8 @@ bool netenum_t::insert_name(size_t name_idx, perm_string name, const verinum&val
{
std::pair<std::map<perm_string,verinum>::iterator, bool> res;
assert(val.has_len() && val.len() == (msb_-lsb_+1));
assert((msb_-lsb_+1) > 0);
assert(val.has_len() && val.len() == (unsigned)(msb_-lsb_+1));
// Insert a map of the name to the value. This also gets a
// flag that returns true if the name is unique, or false

View File

@ -2440,6 +2440,7 @@ void pform_set_integer_2atom(uint64_t width, bool signed_flag, list<perm_string>
static void pform_set_enum(const struct vlltype&li, enum_type_t*enum_type,
perm_string name)
{
(void) li; // The line information is not currently needed.
PWire*cur = pform_get_make_wire_in_scope(name, NetNet::REG, NetNet::NOT_A_PORT, enum_type->base_type);
assert(cur);

View File

@ -123,6 +123,11 @@ extern struct vector_info draw_vpi_func_call(ivl_expr_t expr,
unsigned wid);
extern int draw_vpi_rfunc_call(ivl_expr_t expr);
/*
* Enumeration draw routine.
*/
void draw_enumeration_in_scope(ivl_enumtype_t enumtype);
/*
* Switches (tran)
*/

View File

@ -1680,7 +1680,7 @@ bool vector4_to_value(const vvp_vector4_t&vec, double&val, bool signed_flag)
bool vector2_to_value(const vvp_vector2_t&a, int32_t&val, bool is_signed)
{
val = 0;
int idx;
unsigned idx;
int32_t mask;
for (idx = 0, mask = 1 ; idx < a.size() && idx < 32 ; idx += 1, mask <<= 1) {
if (a.value(idx)) val |= mask;