- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
While using the left-to-right stream operator in Modelsim Altera Strater Edition 10.1e with the following code:
module stream_bug();
bit stream='{32{1'b0}};
initial begin
$monitor("@%0dns stream= %b",$time, stream);
# 1 stream={>>{8'b11010001}};
# 1 stream={>>{ 'b11010001}};
end
endmodule
The output is:# @0ns stream= 00000000000000000000000000000000# @1ns stream= 11010001000000000000000000000000# @2ns stream= 00000000000000000000000011010001 Shouldn't the "stream" value be the same in 1ns and 2ns?:confused:
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No "8'b11010001" is a 8 bit sized number but " 'b11010001" is a simulator defined sized number, but at least 32 bit.
It is a common misconception that a ticked(') number without an explicit size is automatically sized based on the usage in that particular usage but that is not true. It is essentially the simulator default size. So you either packing in 8 bits or however many bits the simulator feels like giving you.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- No "8'b11010001" is a 8 bit sized number but " 'b11010001" is a simulator defined sized number, but at least 32 bit. It is a common misconception that a ticked(') number without an explicit size is automatically sized based on the usage in that particular usage but that is not true. It is essentially the simulator default size. So you either packing in 8 bits or however many bits the simulator feels like giving you. --- Quote End --- I think that's the case. Thanks:D
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are no longer any simulator dependent sizes in Verilog or SystemVerilog. All numeric literals have an explicit or implicit size.
A numeric literal without an explicit size will be the larger of either: 32 bits or the number of bits needed to express the literal. See http://www.eda.org/svdb/view.php?id=1107
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