From df177bfd5be2264946f060ea625c9f03b6906d76 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 13 Feb 2018 20:38:48 +0800 Subject: [PATCH] use new misoc identifier --- artiq/firmware/libboard/ident.rs | 12 +++++++----- conda/artiq-dev/meta.yaml | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/artiq/firmware/libboard/ident.rs b/artiq/firmware/libboard/ident.rs index 26b5befdc..76ce2382d 100644 --- a/artiq/firmware/libboard/ident.rs +++ b/artiq/firmware/libboard/ident.rs @@ -1,13 +1,15 @@ -use core::{ptr, cmp, str}; +use core::{cmp, str}; use csr; pub fn read(buf: &mut [u8]) -> &str { unsafe { - let len = ptr::read_volatile(csr::IDENTIFIER_MEM_BASE); - let len = cmp::min(len as usize, buf.len()); + csr::identifier::address_write(0); + let len = csr::identifier::data_read(); + let len = cmp::min(len, buf.len() as u8); for i in 0..len { - buf[i] = ptr::read_volatile(csr::IDENTIFIER_MEM_BASE.offset(1 + i as isize)) as u8 + csr::identifier::address_write(1 + i); + buf[i as usize] = csr::identifier::data_read(); } - str::from_utf8_unchecked(&buf[..len]) + str::from_utf8_unchecked(&buf[..len as usize]) } } diff --git a/conda/artiq-dev/meta.yaml b/conda/artiq-dev/meta.yaml index 08930c06e..a1b715eb2 100644 --- a/conda/artiq-dev/meta.yaml +++ b/conda/artiq-dev/meta.yaml @@ -15,7 +15,7 @@ requirements: - python >=3.5.3,<3.6 - setuptools 33.1.1 - migen 0.7 py35_2+git40721b2 - - misoc 0.9 py35_2+git8435d832 + - misoc 0.9 py35_3+git684b519a - jesd204b 0.4 - microscope - binutils-or1k-linux >=2.27