Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/verilog/expr2verilog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1348,6 +1348,10 @@ expr2verilogt::convert_constant(const constant_exprt &src)
else
return convert_norep(src);
}
else if(type.id() == ID_verilog_null)
{
dest = "null";
}
else
return convert_norep(src);

Expand Down
10 changes: 10 additions & 0 deletions src/verilog/verilog_lowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,16 @@ exprt verilog_lowering_cast(typecast_exprt expr)
auto &src_type = expr.op().type();
auto &dest_type = expr.type();

if(src_type.id() == ID_verilog_null && dest_type.id() == ID_verilog_chandle)
{
return to_verilog_chandle_type(dest_type).null_expr();
}

if(src_type.id() == ID_verilog_null && dest_type.id() == ID_verilog_event)
{
return to_verilog_event_type(dest_type).null_expr();
}

// float to int
if(
(src_type.id() == ID_verilog_real ||
Expand Down
7 changes: 2 additions & 5 deletions src/verilog/verilog_typecheck_expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2313,11 +2313,8 @@ void verilog_typecheck_exprt::implicit_typecast(
dest_type.id() == ID_verilog_class_type ||
dest_type.id() == ID_verilog_event)
{
if(expr.id() == ID_constant)
{
expr.type() = dest_type;
return;
}
expr = typecast_exprt{expr, dest_type};
return;
}
}

Expand Down
Loading