Re: Ich hatte einen Traum...
Verfasst: Mi 4. Jan 2012, 14:15
Anbei eine Idee um eine CPU cog und eine MMU cog zu synchronisieren. Meine Hive ist nog nicht fertig und PASM ist neu fur mich, also alles völlig ungetested. Das Idee ist um ein I/O pin (nur das heartbeat led is nog frei) zur synchronization zu benutzen, und um das CPU cog an ausführung einer instruktion arbeiten zu lassen, weil das MMU cog der nächste instruktion bearbeitet.
Paul
Hive Experten, funktioniert so etwas?
Paul
Paul
Code: Alles auswählen
CPU Cog:
start wrlong mmu_addr, pc
or outa, #htbeat
add pc, #4
andn outa, #htbeat
loop waitpne #htbeat, #htbeat
rdlong mmu_data, instr
wrlong mmu_addr, pc
or outa, #htbeat
add pc, #4
andn outa, #htbeat
/* decode & process 'instr' here*/
jmp #loop
MMU Cog:
loop waitpeq #htbeat, #htbeat
or outa, #htbeat
rdlong mmu_addr, addr
/* access external RAM here */
wrlong mmu_data, data
andn outa,#htbeat
jmp #loop
Paul