joaohf Posted March 23 Report Share Posted March 23 I want to use SystemRDL to define some registers for a peripheral I2C device. I tried the following spec: regfile eTACHS { name = "TACH registers"; reg { name = "Read tach"; field { desc = "Checksum-byte 0xFF means not ready"; } CHECK[7:0] = 0; field { desc = "All 16bits should be 0x0000"; } ZEROS[15:8] = 0; field { desc = "Value with the RPM"; } TACH[24:16] = 0; field { desc = "Rest of the buffer is discarded"; } RESERVED[31:25] = 0; } READ_TACH0 @ 0x0a; reg { name = "Read tach"; field { desc = "Checksum-byte 0xFF means not ready"; } CHECK[7:0] = 0; field { desc = "All 16bits should be 0x0000"; } ZEROS[15:8] = 0; field { desc = "Value with the RPM"; } TACH[24:16] = 0; field { desc = "Rest of the buffer is discarded"; } RESERVED[31:25] = 0; } READ_TACH1 @ 0x0b; }; addrmap fan { name = "FAN registers"; eTACHS TACHS; }; The data size for each I2C command is 32 bits. The above rdl when I tried to `dump` it, I got the following result: peakrdl dump fan_i2c.rdl fan_i2c.rdl:36:7: error: Instance 'READ_TACH1' at offset +0xB:0xE overlaps with 'READ_TACH0' at offset +0xA:0xD } READ_TACH1 @ 0x0b; ^^^^^^^^^^ fatal: Elaborate aborted due to previous errors My I2C peripheral device is a set of commands like: READ_TACH0 = 0x0a READ_TACH1 = 0x0b .... The are many commands like that. With SystemRDL, would it be possible to define a RDL for I2C slave register map ? Maybe some way to avoid overlaps errors ? Well, I could find a RDL example for I2C specification. Thanks Quote Link to comment Share on other sites More sharing options...
Richard Weber Posted March 25 Report Share Posted March 25 It would appear that you are trying to use register numbers or word addresses to specify byte addresses. The registers seem to be 32-bits or 4 bytes wide. Left shift the register number or word address by at least 2 bits to get a byte address that avoids the overlap. Example: } READ_TACH0 @ (0x0a << 2); } READ_TACH1 @ (0x0b << 2); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.