From 6edade339744b6631717242b0111f5dc1ae79194 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Fri, 13 Sep 2024 15:14:30 -0700 Subject: Allow cloning ancestor multiple times on each core --- src/arch/salis-v1.c | 19 +++++++++++++------ src/salis.c | 14 ++++++++++---- 2 files changed, 23 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/arch/salis-v1.c b/src/arch/salis-v1.c index 9268d50..1085883 100644 --- a/src/arch/salis-v1.c +++ b/src/arch/salis-v1.c @@ -200,15 +200,22 @@ void arch_on_proc_kill(Core *core) { void arch_anc_init(Core *core, u64 size) { assert(core); - Proc *panc = proc_fetch(core, 0); - #if ANC_HALF == 1 - panc->mb0a = U64_HALF; - panc->ip = U64_HALF; - panc->sp = U64_HALF; + u64 addr = U64_HALF; +#else + u64 addr = 0; #endif - panc->mb0s = size; + for (int i = 0; i < ANC_CLONES; ++i) { + u64 addr_clone = addr + ((MVEC_SIZE / ANC_CLONES) * i); + + Proc *panc = proc_fetch(core, i); + + panc->mb0a = addr_clone; + panc->mb0s = size; + panc->ip = addr_clone; + panc->sp = addr_clone; + } } #endif diff --git a/src/salis.c b/src/salis.c index 24f3966..814dd0d 100644 --- a/src/salis.c +++ b/src/salis.c @@ -316,8 +316,13 @@ u64 core_assemble_ancestor(int cix, const char *anc) { for (int i = 0; i < 0x100; ++i) { if (strcmp(line, g_mnemo_table[i]) == 0) { - mvec_alloc(core, addr); - mvec_set_inst(core, addr, i); + for (u64 j = 0; j < ANC_CLONES; ++j) { + u64 addr_clone = addr + ((MVEC_SIZE / ANC_CLONES) * j); + + mvec_alloc(core, addr_clone); + mvec_set_inst(core, addr_clone, i); + } + #ifndef NDEBUG line_ok = true; #endif @@ -347,8 +352,9 @@ void core_init(int cix, u64 *seed, const char *anc) { core->muta[3] = muta_smix(seed); } - core->pnum = 1; - core->pcap = 1; + core->pnum = ANC_CLONES; + core->pcap = ANC_CLONES; + core->plst = ANC_CLONES - 1; core->iviv = calloc(SYNC_INTERVAL, sizeof(u8)); core->ivav = calloc(SYNC_INTERVAL, sizeof(u64)); core->pvec = calloc(core->pcap, sizeof(Proc)); -- cgit v1.2.1