2024-11-01 10:54:59 +00:00
|
|
|
package cpu
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
|
|
|
|
"git.elyanpoujol.fr/elyan/central-arch/pkg/instr"
|
2024-11-03 18:38:44 +00:00
|
|
|
"git.elyanpoujol.fr/elyan/central-arch/pkg/siminstr"
|
2024-11-01 10:54:59 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
const instrMask = 0x7f
|
|
|
|
|
2024-11-03 18:38:44 +00:00
|
|
|
func (cpu *Cpu) RegisterInstr(desc siminstr.SimInstrDesc) {
|
2024-11-01 10:54:59 +00:00
|
|
|
// TODO Implement it
|
2024-11-03 18:38:44 +00:00
|
|
|
log.Printf("Registered: %s\n", desc.InstrDesc.VariantName)
|
2024-11-01 10:54:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (cpu *Cpu) GetOpCode(i instr.Instr) uint32 {
|
|
|
|
return uint32(i & instrMask)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (cpu *Cpu) GetFormat(i instr.Instr) instr.InstrFormat {
|
|
|
|
panic("Not implemented yet")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (cpu *Cpu) Decode(i instr.Instr, decodedInstr *instr.DecodedInstr) {
|
|
|
|
panic("Not implemented yet")
|
|
|
|
}
|