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

Fix so there can be space between two register fields #6

Closed
wants to merge 2 commits into from
Closed

Fix so there can be space between two register fields #6

wants to merge 2 commits into from

Conversation

vermaete
Copy link
Collaborator

@vermaete vermaete commented Apr 7, 2014

I have added a new register (reg7) with a test case.

@oddball
Copy link
Owner

oddball commented Apr 7, 2014

This does not work. What happens when you have two holes in the register? In SystemVerilog, Hole 1, will be called None, and Hole 2 will be called? Are you running the testcases?

Also I want the SystemVerilog and VHDL structs to have the same fields in the same positions. Common case is to serialize a register over a 1 bit line, and then pack it again on the other side. Perhaps one side is SystemVerilog, and the other VHDL.

@vermaete
Copy link
Collaborator Author

vermaete commented Apr 7, 2014

Don't know that much about SystemVerilog. And my Modelsim isn't supporting it :-(
But I just made (local) a testcase with reg7 with two hole (one more as in the commit). I have added the field 'MSB' at bit 32.
Rst (pdf/html) looks fine. VHDL package too.

  function reg7_record_type_to_sulv (v : reg7_record_type) return std_ulogic_vector is
    variable r : std_ulogic_vector (data_width-1 downto 0);
  begin
    r :=  (others => '0');
    r(31) := v.field2;
    r(25 downto 16) := v.field1;
    r(9 downto 0) := v.field0;
    return r;
  end function;

So, the holes are filled with '0', as it was before the change.

The fields with no name (=None) are not taken in the code to make the RTL or the ReST.

Anyhow, I will check it tomorrow with a better simulator and test it in my design. If I have time, I will make a VHDL testbench.

reg7


typedef struct packed {
bit [9:0] field1;//bits [25:16]
bit [5:0] None;//bits [15:10]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are 2 fields with the same name, there will be a name clash.

@oddball
Copy link
Owner

oddball commented Jul 4, 2014

There is another fix that allows space between two register fields. One that leaves the SystemVerilog generation intact.

Cherry picked: path to export pointing to the xsd files was wrong 99804e5

Closing this PR

@oddball oddball closed this Jul 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants