Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
mock-turtle
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
hdl-core-lib
mock-turtle
Commits
b0844b77
Commit
b0844b77
authored
Jul 23, 2018
by
Federico Vaga
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'ohwr/master'
parents
4e847792
9b36bddf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
7 deletions
+30
-7
mock_turtle_driver.svh
hdl/testbench/include/mock_turtle_driver.svh
+16
-4
mt_cpu_csr_driver.svh
hdl/testbench/include/mt_cpu_csr_driver.svh
+14
-3
No files found.
hdl/testbench/include/mock_turtle_driver.svh
View file @
b0844b77
...
...
@@ -57,6 +57,7 @@ typedef virtual IMockTurtleIRQ vIMockTurtleIRQ;
// The main class, to monitor and drive the complete MT
class
MockTurtleDriver
;
protected
string
name
;
protected
CWishboneAccessor
acc
;
protected
uint64_t
base
;
protected
uint32_t
core_count
;
...
...
@@ -66,12 +67,23 @@ class MockTurtleDriver;
protected
vIMockTurtleIRQ
irq
;
MDebug
dbg
;
function
new
(
CWishboneAccessor
acc
,
uint64_t
base
,
vIMockTurtleIRQ
irq
)
;
function
new
(
CWishboneAccessor
acc
,
uint64_t
base
,
vIMockTurtleIRQ
irq
,
string
name
=
""
)
;
this
.
name
=
name
;
this
.
acc
=
acc
;
this
.
base
=
base
;
this
.
irq
=
irq
;
endfunction
// new
task
mdisplay
(
string
str
)
;
string
tmp
;
if
(
this
.
name
==
""
)
tmp
=
str
;
else
tmp
=
$
sformatf
(
"[%s] %s"
,
this
.
name
,
str
)
;
$
display
(
tmp
)
;
endtask
// mdisplay
task
init
(
wb_cycle_type_t
mode
=
PIPELINED
)
;
uint32_t
slot_count
;
wb_set_mode
(
mode
)
;
...
...
@@ -79,10 +91,10 @@ class MockTurtleDriver;
rom
=
new
(
acc
,
base
+
'he000
)
;
rom
.
init
()
;
core_count
=
rom
.
getCoreCount
()
;
$
display
(
"App ID: 0x%x"
,
rom
.
getAppID
)
;
$
display
(
"Core count: %0d"
,
core_count
)
;
mdisplay
($
sformatf
(
"App ID: 0x%x"
,
rom
.
getAppID
)
)
;
mdisplay
($
sformatf
(
"Core count: %0d"
,
core_count
)
)
;
// Next init the MT CSR
csr
=
new
(
acc
,
base
+
'hc000
,
core_count
)
;
csr
=
new
(
acc
,
base
+
'hc000
,
core_count
,
name
)
;
csr
.
init
()
;
// Debug interface
dbg
=
new
(
acc
,
csr
)
;
...
...
hdl/testbench/include/mt_cpu_csr_driver.svh
View file @
b0844b77
...
...
@@ -40,7 +40,7 @@
typedef
uint32_t
t_notify_queue
[$]
;
class
MTCPUControl
;
protected
string
name
;
protected
CBusAccessor
bus
;
protected
uint32_t
base
;
protected
uint32_t
core_count
;
...
...
@@ -48,12 +48,23 @@ class MTCPUControl;
t_notify_queue
notify_queue
[]
;
function
new
(
CBusAccessor
bus
,
input
uint32_t
base
,
int
core_count
)
;
function
new
(
CBusAccessor
bus
,
input
uint32_t
base
,
int
core_count
,
string
name
=
""
)
;
this
.
name
=
name
;
this
.
base
=
base
;
this
.
bus
=
bus
;
this
.
core_count
=
core_count
;
endfunction
// new
task
mdisplay
(
string
str
)
;
string
tmp
;
if
(
this
.
name
==
""
)
tmp
=
str
;
else
tmp
=
$
sformatf
(
"[%s] %s"
,
this
.
name
,
str
)
;
$
display
(
tmp
)
;
endtask
// mdisplay
task
writel
(
uint32_t
r
,
uint32_t
v
)
;
bus
.
write
(
base
+
r
,
v
)
;
endtask
// _write
...
...
@@ -156,7 +167,7 @@ class MTCPUControl;
if
(
rval
==
0
||
rval
==
13
||
rval
==
10
)
begin
$
display
(
"UART MSG from core %0d: %s"
,
i
,
dbg_msg_queue
[
i
]
)
;
mdisplay
($
sformatf
(
"UART MSG from core %0d: %s"
,
i
,
dbg_msg_queue
[
i
])
)
;
dbg_msg_queue
[
i
]
=
""
;
end
else
...
...
Write
Preview
Markdown
is supported
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