Comments (6)
xo_emit_field() pointed out to me by @allanjude -- apparently it does exactly what I need for exactly this reason. Unfortunately, I failed to find it when spelunking. Can I suggest an Xref from the xo_emit(3) man page?
from libxo.
Apparently this is, in fact, because it doesn't have a man page. Reopening as a bug report. :-)
from libxo.
I should also comment that you should avoid underscores and upper case field names. Please review the guidelines at:
https://libxo.readthedocs.io/en/latest/faq.html#what-makes-a-good-field-name
I'm guessing these are real concrete register names, so perhaps these don't apply, or perhaps you should use a more flexible schema, like:
<register>
<name>L1D_CACHE_ACCESS</name>
<value>10</value>
<register>
<register>
<name>L1D_CACHE_LIMIT</name>
<value>1024</value>
</register>
This gives you some benefits:
- allows the receiver to look for specific values (e.g. 'register[name=="L1D_CACHE_ACCESS"]/value')
- allows the receiver to handle values generically ('for-each (register) { call foo(name, value); }')
- allows names that are not xml-compatible (starting with a number)
- allows names to vary while having a simple, fixed schema
- lets you use the native hardware names that violate the field name guidelines
Thanks,
Phil
from libxo.
They are names defined by the architecture spec itself, so we can't change those. I agree that they are not very desirable (for all the reasons you suggest).
I did originally use the schedule you described, but it made things rather more messy to deal with in Python in our lab templates. This model removes a level of data-structure indirection, which does actually simplify things substantially.
from libxo.
Fix is in 'develop' branch:
https://raw.githubusercontent.com/Juniper/libxo/develop/libxo/xo_emit_field.3
Thanks,
Phil
from libxo.
Fixed in libxo-1.5.0
from libxo.
Related Issues (20)
- 'plain' output with a defined field-separator HOT 9
- Add "--continuation" option to "xo" to allow multiple html lines
- Document "xo"'s --not-first option HOT 1
- "xo" need option to make JSON object wrapper HOT 1
- "xo" needs a means of handling lists and instances HOT 1
- Newline before closing brace in json output HOT 2
- libtool makes unreliable executable names HOT 1
- 1.3.1 Ubuntu 18.04 WSL missing so HOT 3
- typo HOT 2
- Fails to build with GCC on FreeBSD HOT 2
- check width of unicode characters
- FreeBSD's json format prints an unescaped new line before the final closing bracket HOT 2
- Man pages not escaping some newlines (PR included) HOT 1
- XOF_UNDERSCORES: hyphens in topmost keys are not replaced HOT 2
- xo/xo.c#L99: add missing UNUSED marker for all unused flags HOT 2
- libxo inconsistent field truncation HOT 3
- Linux: <sys/sysctl.h> missing HOT 2
- Core dump when compile with gcc 10 HOT 3
- xo.h defines NORETURN and PRINTFLIKE without a "XO_" prefix
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libxo.