mirror of https://github.com/m-labs/artiq.git
runtime,gateware: use new misoc identifier
This commit is contained in:
parent
44c0c617f3
commit
ae99af27ee
|
@ -21,6 +21,7 @@ from artiq.gateware.soc import AMPSoC
|
|||
from artiq.gateware import rtio, nist_qc1, nist_qc2
|
||||
from artiq.gateware.rtio.phy import ttl_simple, ttl_serdes_7series, dds
|
||||
from artiq.tools import artiq_dir
|
||||
from artiq import __version__ as artiq_version
|
||||
|
||||
|
||||
class _RTIOCRG(Module, AutoCSR):
|
||||
|
@ -98,7 +99,9 @@ class _NIST_QCx(MiniSoC, AMPSoC):
|
|||
cpu_type=cpu_type,
|
||||
sdram_controller_type="minicon",
|
||||
l2_size=128*1024,
|
||||
with_timer=False, **kwargs)
|
||||
with_timer=False,
|
||||
ident=artiq_version,
|
||||
**kwargs)
|
||||
AMPSoC.__init__(self)
|
||||
|
||||
self.submodules.leds = gpio.GPIOOut(Cat(
|
||||
|
|
|
@ -21,6 +21,7 @@ from artiq.gateware.soc import AMPSoC
|
|||
from artiq.gateware import rtio, nist_qc1
|
||||
from artiq.gateware.rtio.phy import ttl_simple, ttl_serdes_spartan6, dds
|
||||
from artiq.tools import artiq_dir
|
||||
from artiq import __version__ as artiq_version
|
||||
|
||||
|
||||
class _RTIOCRG(Module, AutoCSR):
|
||||
|
@ -118,7 +119,9 @@ class NIST_QC1(BaseSoC, AMPSoC):
|
|||
BaseSoC.__init__(self,
|
||||
cpu_type=cpu_type,
|
||||
l2_size=64*1024,
|
||||
with_timer=False, **kwargs)
|
||||
with_timer=False,
|
||||
ident=artiq_version,
|
||||
**kwargs)
|
||||
AMPSoC.__init__(self)
|
||||
|
||||
platform = self.platform
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#include "log.h"
|
||||
#include "clock.h"
|
||||
|
||||
static int clkdiv;
|
||||
|
||||
void clock_init(void)
|
||||
{
|
||||
|
@ -11,7 +10,6 @@ void clock_init(void)
|
|||
timer0_load_write(0x7fffffffffffffffLL);
|
||||
timer0_reload_write(0x7fffffffffffffffLL);
|
||||
timer0_en_write(1);
|
||||
clkdiv = identifier_frequency_read()/1000;
|
||||
}
|
||||
|
||||
long long int clock_get_ms(void)
|
||||
|
@ -22,7 +20,7 @@ long long int clock_get_ms(void)
|
|||
timer0_update_value_write(1);
|
||||
clock_sys = 0x7fffffffffffffffLL - timer0_value_read();
|
||||
|
||||
clock_ms = clock_sys/clkdiv;
|
||||
clock_ms = clock_sys/(SYSTEM_CLOCK_FREQUENCY/1000);
|
||||
return clock_ms;
|
||||
}
|
||||
|
||||
|
@ -31,7 +29,7 @@ void busywait_us(long long int us)
|
|||
long long int threshold;
|
||||
|
||||
timer0_update_value_write(1);
|
||||
threshold = timer0_value_read() - us*(long long int)identifier_frequency_read()/1000000LL;
|
||||
threshold = timer0_value_read() - us*SYSTEM_CLOCK_FREQUENCY/1000000LL;
|
||||
while(timer0_value_read() > threshold)
|
||||
timer0_update_value_write(1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue