Skip to content

Commit 6b3b2a1

Browse files
committed
tweak inout insn register writes
1 parent 300bfd5 commit 6b3b2a1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

pkg/asm/compiler/insn.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ func (p *StateTranslator[F, T, E, M]) translateInOut(cc uint, codes []micro.Code
7575
// NOTE: we have to pretend that we've written registers here, otherwise
7676
// forwarding will not be enabled.
7777
p.WriteRegisters(code.RegistersWritten())
78-
p.WriteRegister(code.Bus().EnableLine)
7978
// Enable line must be set high
8079
enabled := p.ReadRegister(code.Bus().EnableLine).Equals(Number[T, E](1))
8180
//

pkg/asm/io/micro/inout.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,15 @@ func (p *InOut) RegistersRead() []io.RegisterId {
8282

8383
// RegistersWritten returns the set of registers written by this instruction.
8484
func (p *InOut) RegistersWritten() []io.RegisterId {
85+
// Wrutes always include the enable line
86+
var writes = []io.RegisterId{p.bus.EnableLine}
87+
//
8588
if p.input {
86-
return p.bus.Data()
89+
// input instruction considered as a write to data lines.
90+
writes = append(writes, p.bus.Data()...)
8791
}
8892
//
89-
return nil
93+
return writes
9094
}
9195

9296
// Split this micro code using registers of arbirary width into one or more

0 commit comments

Comments
 (0)