Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trace of struct array not working correctly #742

Closed
veripoolbot opened this issue Apr 15, 2014 · 2 comments
Closed

trace of struct array not working correctly #742

veripoolbot opened this issue Apr 15, 2014 · 2 comments

Comments

@veripoolbot
Copy link
Contributor

@veripoolbot veripoolbot commented Apr 15, 2014


Author Name: Jie Xu (@jiexu)
Original Redmine Issue: 742 from https://www.veripool.org
Original Date: 2014-04-15
Original Assignee: Wilson Snyder (@wsnyder)


For the following code, the generated VCD dump file will only have tt[31:0].




module test (clk, result);

input  wire       clk;
output wire [31:0] result;

typedef struct packed {
     logic [31:0] data;
} tt_t;

tt_t [1:0] tt;

initial begin
tt[0] = 'hff;
tt[1] = 'h0;
end

assign result = tt[0] | tt[1];

always_ff @ (posedge clk)
begin
     tt[0] <= tt[0] - 1;
     tt[1] <= tt[1] + 1;
end
endmodule

I did some investigation in the Verilator source. The cause of this problem is when @tt@ signal is declared for tracing, Verilator use @bitRange@ infomation which is actually the the structure @tt_t@ information. And when @AstTraceDecl@ is created in @V3TraceDecl.cpp@, @arrayRange@ is not used. So the final VCD dump will only show the value of the first struct inside the array.

Note the tracing works with "--trace-structs" option.

@veripoolbot
Copy link
Contributor Author

@veripoolbot veripoolbot commented Apr 16, 2014


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2014-04-16T00:21:10Z


Fixed in git towards 3.857.

Note without --trace-structs, as this is a packed array it should have and will now trace it as <63:0> as that is the size it has as a packed array. With --trace-structs, you'll see the separate fields, but the tracing is larger and slower thanks to the ugly VCD file format.

@veripoolbot
Copy link
Contributor Author

@veripoolbot veripoolbot commented May 11, 2014


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2014-05-11T21:08:42Z


In 3.860.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.