Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
MATANA
Matana on Chipyard
Commits
70ab79e2
Commit
70ab79e2
authored
Oct 01, 2021
by
Yuxiao Mao
Browse files
Timer: add larger window
parent
39a6efbf
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/scala/DetectPatternTimer.scala
View file @
70ab79e2
...
...
@@ -33,23 +33,45 @@ class DetectPatternTimerInternal(params: DetectPatternTimerParams)(implicit mp:
// Registed (valid) pack analysis result for multiple slow cycles
val
npackSize
:
Int
=
params
.
npackSizeInFastCycles
/
mp
.
clockDiv
val
npackSize2
:
Int
=
npackSize
*
2
;
val
npackSize4
:
Int
=
npackSize
*
4
;
val
npackSize8
:
Int
=
npackSize
*
8
;
val
npack_timer
=
RegInit
(
0.
U
(
npackSize
.
W
)).
suggestName
(
"npack_timer"
)
val
npack_timer
=
RegInit
(
0.
U
(
npackSize
8
.
W
)).
suggestName
(
"npack_timer"
)
val
npack_timer_orR
=
RegInit
(
false
.
B
)
val
npack_timer_orR2
=
RegInit
(
false
.
B
)
val
npack_timer_orR4
=
RegInit
(
false
.
B
)
val
npack_timer_orR8
=
RegInit
(
false
.
B
)
when
(
in
.
pack_has_valid
)
{
npack_timer
:=
Cat
(
npack_timer
(
npackSize
-
2
,
0
),
in
.
pack_has_timer
)
npack_timer
:=
Cat
(
npack_timer
(
npackSize
8
-
2
,
0
),
in
.
pack_has_timer
)
npack_timer_orR
:=
npack_timer
(
npackSize
-
2
,
0
).
orR
||
in
.
pack_has_timer
npack_timer_orR2
:=
npack_timer
(
npackSize2
-
2
,
0
).
orR
||
in
.
pack_has_timer
npack_timer_orR4
:=
npack_timer
(
npackSize4
-
2
,
0
).
orR
||
in
.
pack_has_timer
npack_timer_orR8
:=
npack_timer
(
npackSize8
-
2
,
0
).
orR
||
in
.
pack_has_timer
}
val
atk_timer_timer
=
Wire
(
Bool
())
val
atk_timer_timer2
=
Wire
(
Bool
())
val
atk_timer_timer4
=
Wire
(
Bool
())
val
atk_timer_timer8
=
Wire
(
Bool
())
atk_timer_timer
:=
npack_timer_orR
&&
in
.
pack_has_timer
&&
in
.
isMonitoring
atk_timer_timer2
:=
npack_timer_orR2
&&
in
.
pack_has_timer
&&
in
.
isMonitoring
atk_timer_timer4
:=
npack_timer_orR2
&&
in
.
pack_has_timer
&&
in
.
isMonitoring
atk_timer_timer8
:=
npack_timer_orR2
&&
in
.
pack_has_timer
&&
in
.
isMonitoring
val
atk_timer_flush
=
Wire
(
Bool
())
atk_timer_flush
:=
npack_timer_orR
&&
in
.
pack_has_flush
&&
in
.
isMonitoring
override
def
regmap
(
offset
:
Int
)
=
(
if
(
params
.
withTimerTimer
)
RegmapUtil
.
countEventThreshAlarm
(
atk_timer_timer
,
in
.
resetCounters
,
offset
,
"AtkTimerTimer"
)
else
Nil
)
++
(
if
(
params
.
withTimerFlush
)
RegmapUtil
.
countEventThreshAlarm
(
atk_timer_flush
,
in
.
resetCounters
,
offset
+
0x10
,
"AtkTimerFlush"
)
else
Nil
)
(
if
(
params
.
withTimerTimer
)
{
RegmapUtil
.
countEventThreshAlarm
(
atk_timer_timer
,
in
.
resetCounters
,
offset
,
"AtkTimerTimer"
)
++
RegmapUtil
.
countEvent
(
atk_timer_timer2
,
in
.
resetCounters
,
offset
+
0x10
,
"AtkTimerTimer2"
)
++
RegmapUtil
.
countEvent
(
atk_timer_timer4
,
in
.
resetCounters
,
offset
+
0x14
,
"AtkTimerTimer4"
)
++
RegmapUtil
.
countEvent
(
atk_timer_timer8
,
in
.
resetCounters
,
offset
+
0x18
,
"AtkTimerTimer8"
)
}
else
Nil
)
++
(
if
(
params
.
withTimerFlush
)
{
RegmapUtil
.
countEventThreshAlarm
(
atk_timer_flush
,
in
.
resetCounters
,
offset
+
0x80
,
"AtkTimerFlush"
)
}
else
Nil
)
}
object
DetectPatternTimer
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment