Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
5c864ac8
Commit
5c864ac8
authored
Jul 16, 2019
by
Luis Vega
Committed by
Thierry Moreau
Jul 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix pynq 32-bit address pointers (#3558)
parent
48c1ae45
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
vta/hardware/chisel/src/main/scala/shell/VCR.scala
+11
-3
No files found.
vta/hardware/chisel/src/main/scala/shell/VCR.scala
View file @
5c864ac8
...
@@ -101,7 +101,9 @@ class VCR(implicit p: Parameters) extends Module {
...
@@ -101,7 +101,9 @@ class VCR(implicit p: Parameters) extends Module {
val
rdata
=
RegInit
(
0.
U
(
vp
.
regBits
.
W
))
val
rdata
=
RegInit
(
0.
U
(
vp
.
regBits
.
W
))
// registers
// registers
val
nTotal
=
vp
.
nCtrl
+
vp
.
nECnt
+
vp
.
nVals
+
(
2
*
vp
.
nPtrs
)
val
nPtrs
=
if
(
mp
.
addrBits
==
32
)
vp
.
nPtrs
else
2
*
vp
.
nPtrs
val
nTotal
=
vp
.
nCtrl
+
vp
.
nECnt
+
vp
.
nVals
+
nPtrs
val
reg
=
Seq
.
fill
(
nTotal
)(
RegInit
(
0.
U
(
vp
.
regBits
.
W
)))
val
reg
=
Seq
.
fill
(
nTotal
)(
RegInit
(
0.
U
(
vp
.
regBits
.
W
)))
val
addr
=
Seq
.
tabulate
(
nTotal
)(
_
*
4
)
val
addr
=
Seq
.
tabulate
(
nTotal
)(
_
*
4
)
val
reg_map
=
(
addr
zip
reg
)
map
{
case
(
a
,
r
)
=>
a
.
U
->
r
}
val
reg_map
=
(
addr
zip
reg
)
map
{
case
(
a
,
r
)
=>
a
.
U
->
r
}
...
@@ -167,7 +169,7 @@ class VCR(implicit p: Parameters) extends Module {
...
@@ -167,7 +169,7 @@ class VCR(implicit p: Parameters) extends Module {
}
}
}
}
for
(
i
<-
0
until
(
vp
.
nVals
+
(
2
*
vp
.
nPtrs
)
))
{
for
(
i
<-
0
until
(
vp
.
nVals
+
nPtrs
))
{
when
(
io
.
host
.
w
.
fire
()
&&
addr
(
vo
+
i
).
U
===
waddr
)
{
when
(
io
.
host
.
w
.
fire
()
&&
addr
(
vo
+
i
).
U
===
waddr
)
{
reg
(
vo
+
i
)
:=
wdata
reg
(
vo
+
i
)
:=
wdata
}
}
...
@@ -183,7 +185,13 @@ class VCR(implicit p: Parameters) extends Module {
...
@@ -183,7 +185,13 @@ class VCR(implicit p: Parameters) extends Module {
io
.
vcr
.
vals
(
i
)
:=
reg
(
vo
+
i
)
io
.
vcr
.
vals
(
i
)
:=
reg
(
vo
+
i
)
}
}
for
(
i
<-
0
until
vp
.
nPtrs
)
{
if
(
mp
.
addrBits
==
32
)
{
// 32-bit pointers
for
(
i
<-
0
until
nPtrs
)
{
io
.
vcr
.
ptrs
(
i
)
:=
reg
(
po
+
i
)
}
}
else
{
// 64-bits pointers
for
(
i
<-
0
until
(
nPtrs
/
2
))
{
io
.
vcr
.
ptrs
(
i
)
:=
Cat
(
reg
(
po
+
2
*
i
+
1
),
reg
(
po
+
2
*
i
))
io
.
vcr
.
ptrs
(
i
)
:=
Cat
(
reg
(
po
+
2
*
i
+
1
),
reg
(
po
+
2
*
i
))
}
}
}
}
}
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