intel / device-modeling-language Goto Github PK
View Code? Open in Web Editor NEWLicense: Mozilla Public License 2.0
License: Mozilla Public License 2.0
this is a test issue
#14 is a duplicate
The documentation for read_register states that fields are read lsb first.
The documentation for write_register states that fields are written msb first.
The actual implementation is:
For read:
For write:
Either documentation or implementation needs to be updated.
ecarsten added a comment - 10/Mar/22 2:01 PM:
Doc should be updated so read and write use the same direction. Implementation should be updated accordingly (looks easy).
ecarsten added a comment - 11/Mar/22 7:54 PM:
The documentation for read_register states that fields are read lsb first.
I would interpret the documentation for read as "msb first":
The implementation invokes the `read_field` method of
all sub-fields at least partially covered by `enabled_bytes`, in order
from most to least significant bit.
In any case, this is inconsistent with the implementation, which accesses LSB first. Test of current behaviour:
--- a/test/1.4/lib/T_field.dml
+++ b/test/1.4/lib/T_field.dml
@@ -37,4 +37,14 @@ bank b {
register r4 size 4 @ 12 {
field f @ [31:0] is use_get_val;
}
+
+ register r5 size 4 @ 16 {
+ saved uint64 written;
+ field a[i < 4] @ [i * 8 + 7 : i * 8] is write {
+ method write(uint64 val) {
+ written <<= 8;
+ written[7:0] = val;
+ }
+ }
+ }
}
diff --git a/test/1.4/lib/T_field.py b/test/1.4/lib/T_field.py
index 9496f1d9..3233107e 100644
--- a/test/1.4/lib/T_field.py
+++ b/test/1.4/lib/T_field.py
@@ -7,3 +7,7 @@ for name in ['r1', 'r2', 'r3', 'r4']:
setattr(obj, 'b_' + name, 4)
# set adds 1, get adds 2
stest.expect_equal(getattr(obj, 'b_' + name), 7)
+
+dev_util.Register_LE(obj.bank.b, 16).write(0xaabbccdd)
+# lsb written first
+stest.expect_equal(obj.bank.b.r5_written, 0xddccbbaa)
The 1.2 behaviour is to access MSB first, as documented, so either we have to switch existing 1.4 devs from LSB-first to MSB-first, or we have to migrate every remaining 1.2 dev from MSB-first to LSB-first while migrating to 1.4 (possibly with extra pain from supporting both orders in parallel during a migration window). Both seem like similar amounts of work. Any opinions on which one is preferable?
I recall from ancient times that the 1.2 order (MSB first) happened to be practical more often than it was impractical. OTOH, most regs use little-endian byte order which makes "LSB first" feel more natural (it means that the field with lowest address is written first, if different fields cover different bytes).
Blocked by #13
I've noticed its not really easy to access this manual by searching the web. I get some links to 1.2 reference manual, but given DMLC here does support 1.4 and the source is public, the language reference manual for 1.4 and the style guide should be accessible as well.
I suggest to find some way to distribute the manual and link it here in the repo, maybe in the README
another test issue
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.