forked from M-Labs/artiq
runtime: support arbitrarily long initial DDS setup time
This commit is contained in:
parent
92efde1e40
commit
6861d28d2d
@ -73,7 +73,7 @@ class LinkInterface:
|
||||
class Environment(LinkInterface):
|
||||
def __init__(self, ref_period):
|
||||
self.ref_period = ref_period
|
||||
self.initial_time = 10000
|
||||
self.initial_time = 2000
|
||||
|
||||
def emit_object(self):
|
||||
tm = lt.TargetMachine.new(triple="or1k", cpu="generic")
|
||||
|
@ -18,9 +18,19 @@
|
||||
|
||||
#define RTIO_FUD_CHANNEL 4
|
||||
|
||||
static void fud_sync(void)
|
||||
{
|
||||
rtio_chan_sel_write(RTIO_FUD_CHANNEL);
|
||||
while(rtio_o_level_read() != 0);
|
||||
}
|
||||
|
||||
static void fud(long long int fud_time)
|
||||
{
|
||||
int r;
|
||||
|
||||
r = rtio_reset_read();
|
||||
rtio_reset_write(0);
|
||||
|
||||
rtio_chan_sel_write(RTIO_FUD_CHANNEL);
|
||||
if(fud_time < 0) {
|
||||
rtio_counter_update_write(1);
|
||||
@ -32,12 +42,11 @@ static void fud(long long int fud_time)
|
||||
rtio_o_timestamp_write(fud_time+3*8);
|
||||
rtio_o_value_write(0);
|
||||
rtio_o_we_write(1);
|
||||
}
|
||||
|
||||
static void fud_sync(void)
|
||||
{
|
||||
rtio_chan_sel_write(RTIO_FUD_CHANNEL);
|
||||
while(rtio_o_level_read() != 0);
|
||||
if(r) {
|
||||
fud_sync();
|
||||
rtio_reset_write(1);
|
||||
}
|
||||
}
|
||||
|
||||
void dds_init(void)
|
||||
|
@ -29,8 +29,8 @@ int main(void)
|
||||
if(length > 0) {
|
||||
k = load_elf(resolve_symbol, "run", kbuf, length, kcode, sizeof(kcode));
|
||||
if(k != NULL) {
|
||||
dds_init();
|
||||
rtio_init();
|
||||
dds_init();
|
||||
flush_cpu_icache();
|
||||
k();
|
||||
kernel_finished();
|
||||
|
Loading…
Reference in New Issue
Block a user