runtime: use device endian for kernel/rpc #126
No reviewers
Labels
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/artiq-zynq#126
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "pca006132/artiq-zynq:master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Together with https://github.com/m-labs/artiq/pull/1588
10a07b8c12
to2c03e281a1
2c03e281a1
tob834d9aaf3
_kernel
isn't a good suffix. It's ARTIQ-specific where this part of the code is otherwise generic (and reusable), and it doesn't describe what is going on.What about
_nativeendian
, or even just_native
(with a comment explaining that this refers to endianness)?Why do we need two versions in the first place?
The analyzer and moninj are using network order.
@ -136,2 +200,4 @@
}
#[inline]
fn write_bytes_kernel(&mut self, value: &[u8]) -> Result<(), Self::WriteError> {
Hmm, do we need this (and also
*_string_native
and*_chunk_native
) or would it be simpler to keep network order for the length?Not entirely sure, I just duplicated them to minimize the changes to existing code.
Though I'm not insisting on that idea; we can instead specify that all ARTIQ firmware protocols always use the endianness of the core device, and have the core device announce its endianness when the host connects.
Or get it from the device database like the compiler does currently.that would breakartiq_rtiomon
That would seem like the simpler solution to me (and we might not even need the announcing endianness part – it's not like moninj/the analyzer are used in situtions where the endianness info from the device db wouldn't be available).
artiq_rtiomon
doesn't use the device db.Will fix. I was thinking about these functions are just limited to kernel usage
comm_kernel
.Actually, would it be better to specify a bool flag? I think the rust compiler may be good enough to inline them. Maybe I should run a benchmark.
b834d9aaf3
tofaa335461d
Updated with https://github.com/m-labs/artiq/pull/1591