Skip to content

Commit

Permalink
Fix fetch next line prefetcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Dolu1990 committed Oct 22, 2024
1 parent 2d24a50 commit 4e3be31
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ext/NaxSoftware
2 changes: 1 addition & 1 deletion src/main/scala/vexiiriscv/fetch/Prefetch.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class PrefetcherNextLinePlugin(lineSize : Int) extends PrefetcherPlugin{

val probeAddressNext = KeepAttribute(io.probe.pc + lineSize)
val address = Reg(Global.PC)
val addressHit = address === io.probe.pc
val addressHit = address.dropLow(log2Up(lineSize)) === io.probe.pc.dropLow(log2Up(lineSize))

val unbuffered = Stream(PrefetchCmd())
unbuffered.valid := False
Expand Down
8 changes: 6 additions & 2 deletions src/main/tcl/openocd/no_prefetch.tcl
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
for {set i 0} {$i < $cpu_count} {incr i} {
targets $_TARGETNAME.$i
halt
}

for {set i 0} {$i < $cpu_count} {incr i} {
targets $_TARGETNAME.$i
reg 2112 0x3
reg 2112 0x2
}

for {set i 0} {$i < $cpu_count} {incr i} {
targets $_TARGETNAME.$i
resume
}

exit

6 changes: 4 additions & 2 deletions src/main/tcl/openocd/with_prefetch.tcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
for {set i 0} {$i < $cpu_count} {incr i} {
targets $_TARGETNAME.$i
halt
}

for {set i 0} {$i < $cpu_count} {incr i} {
targets $_TARGETNAME.$i
Expand All @@ -8,5 +12,3 @@ for {set i 0} {$i < $cpu_count} {incr i} {
targets $_TARGETNAME.$i
resume
}

exit

0 comments on commit 4e3be31

Please sign in to comment.