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

gen_ipbus_addr_decode does not return non-zero exit code when node address errors are detected #36

Closed
tswilliams opened this issue May 12, 2017 · 2 comments
Assignees
Labels

Comments

@tswilliams
Copy link
Collaborator

tswilliams commented May 12, 2017

If the gen_ipbus_addr_decode script detects either of the following errors:

  • overlaps between nodes
  • 'endpoint' nodes whose base address does not align with their address mask (i.e. 2^width)

... it will print corresponding error messages, but it currently still produces an exit code of 0.

Instead, if these errors are detected, the script should finish with an non-zero exit code, before writing the VHDL output file.

@tswilliams tswilliams added this to the v2.5.1 release milestone May 12, 2017
@tswilliams tswilliams self-assigned this May 12, 2017
@tswilliams
Copy link
Collaborator Author

Example address table that leads to 'non-aligned address' errors (for 2 nodes, id and csr:

<node description="Example slaves file">
	<node id="id" address="0x0" description="ID register" fwinfo="endpoint;width=0"/>
	<node id="csr" address="0x43" description="ctrl/stat register" fwinfo="endpoint;width=1">
		<node id="ctrl" address="0x0"/>
		<node id="stat" address="0x1"/>
	</node>
	<node id="xpoint" address="0x57" size="0x4" fwinfo="endpoint;width=2"/>
</node>

Current output of gen_ipbus_addr_decode script for this address table:

main ERROR: Non-aligned base address detected: csr 0x43 0x1
main ERROR: Non-aligned base address detected: xpoint 0x57 0x2
main ERROR: ERROR: Non Aligned address 0b00000000000000000000000001000011 with respect to address bit mask 0b00000000000000000000000000000001
main ERROR: ERROR: Non Aligned address 0b00000000000000000000000001010111 with respect to address bit mask 0b00000000000000000000000000000011
VHDL decode file saved:  ipbus_decode_addr_table.vhd

@tswilliams
Copy link
Collaborator Author

Bug is now fixed (in pull request #37); for an example problematic address table with 'non-aligned address' errors in 2 nodes - csr and xpoint:

<node description="Example slaves file">
	<node id="id" address="0x0" description="ID register" fwinfo="endpoint;width=0"/>
	<node id="csr" address="0x43" description="ctrl/stat register" fwinfo="endpoint;width=1">
		<node id="ctrl" address="0x0"/>
		<node id="stat" address="0x1"/>
	</node>
	<node id="xpoint" address="0x57" size="0x4" fwinfo="endpoint;width=2"/>
</node>

... gen_ipbus_addr_decode now returns with exit code 3 before writing the VHDL file, and produces the following output:

[developer@e4f2df29fc74 build]$ gen_ipbus_addr_decode addr_table_bad3.xml 
main ERROR: Node 'csr' at 0x43: Width, 0x1, produces address mask 0x2 that is not aligned with node's base address
main ERROR: Node 'xpoint' at 0x57: Width, 0x2, produces address mask 0x4 that is not aligned with node's base address
main ERROR: Node errors detected (e.g. non-aligned addresses, or address overlaps); exiting early before writing output

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

No branches or pull requests

1 participant