Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x393
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
x393
Commits
860b1594
Commit
860b1594
authored
Jul 12, 2016
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor fixes
parent
05a118d9
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
433 deletions
+22
-433
socket_command.py
cocotb/socket_command.py
+5
-6
x393_cocotb_server.py
cocotb/x393_cocotb_server.py
+3
-0
x393_dut.v
cocotb/x393_dut.v
+7
-408
x393interfaces.py
cocotb/x393interfaces.py
+5
-4
x393_mem.py
py393/x393_mem.py
+1
-14
x393_1_8_2.Doxyfile
x393_1_8_2.Doxyfile
+1
-1
No files found.
cocotb/socket_command.py
View file @
860b1594
...
@@ -15,6 +15,11 @@ from __future__ import print_function
...
@@ -15,6 +15,11 @@ from __future__ import print_function
#
#
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http:#www.gnu.org/licenses/>.
# along with this program. If not, see <http:#www.gnu.org/licenses/>.
@brief: Provides sockets-related functionality for both the simulation server
and tghe client. Server is linked to the Cocotb and custom modules and controls
the simulation, server is used to replace memory read/write functionality in the
target system
@author: Andrey Filippov
@author: Andrey Filippov
@copyright: 2016 Elphel, Inc.
@copyright: 2016 Elphel, Inc.
@license: GPLv3.0+
@license: GPLv3.0+
...
@@ -97,19 +102,13 @@ class x393Client():
...
@@ -97,19 +102,13 @@ class x393Client():
def
write
(
self
,
address
,
data
):
def
write
(
self
,
address
,
data
):
self
.
cmd
.
setWrite
([
address
,
data
])
self
.
cmd
.
setWrite
([
address
,
data
])
rslt
=
self
.
communicate
(
self
.
cmd
.
toJSON
())
rslt
=
self
.
communicate
(
self
.
cmd
.
toJSON
())
# print("write->",rslt)
def
waitIrq
(
self
,
irqMask
,
wait_ns
):
def
waitIrq
(
self
,
irqMask
,
wait_ns
):
self
.
cmd
.
setWait
([
irqMask
,
wait_ns
])
self
.
cmd
.
setWait
([
irqMask
,
wait_ns
])
rslt
=
self
.
communicate
(
self
.
cmd
.
toJSON
())
rslt
=
self
.
communicate
(
self
.
cmd
.
toJSON
())
# print("waitIrq->",rslt)
def
flush
(
self
):
def
flush
(
self
):
self
.
cmd
.
setFlush
()
self
.
cmd
.
setFlush
()
# print("flush->",self.communicate(self.cmd.toJSON()))
def
read
(
self
,
address
):
def
read
(
self
,
address
):
self
.
cmd
.
setRead
(
address
)
self
.
cmd
.
setRead
(
address
)
# print("read->args",self.cmd.getArgs())
rslt
=
self
.
communicate
(
self
.
cmd
.
toJSON
())
rslt
=
self
.
communicate
(
self
.
cmd
.
toJSON
())
#print("read->",rslt)
return
json
.
loads
(
rslt
)
return
json
.
loads
(
rslt
)
cocotb/x393_cocotb_server.py
View file @
860b1594
...
@@ -15,6 +15,9 @@ from __future__ import print_function
...
@@ -15,6 +15,9 @@ from __future__ import print_function
#
#
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http:#www.gnu.org/licenses/>.
# along with this program. If not, see <http:#www.gnu.org/licenses/>.
@brief: Simulation server for x393_dut.v top Verilog module.
Listens to the socket connection, accepts incoming commands, applies them
to the simulator and sends back data from the model.
@author: Andrey Filippov
@author: Andrey Filippov
@copyright: 2016 Elphel, Inc.
@copyright: 2016 Elphel, Inc.
@license: GPLv3.0+
@license: GPLv3.0+
...
...
cocotb/x393_dut.v
View file @
860b1594
This diff is collapsed.
Click to expand it.
cocotb/x393interfaces.py
View file @
860b1594
...
@@ -17,10 +17,11 @@ from __future__ import print_function
...
@@ -17,10 +17,11 @@ from __future__ import print_function
#
#
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http:#www.gnu.org/licenses/>.
# along with this program. If not, see <http:#www.gnu.org/licenses/>.
@author: Andrey Filippov
@brief I/O Interfaces of the x393 project for simulation using cocotb
@copyright: 2016 Elphel, Inc.
@author Andrey Filippov
@license: GPLv3.0+
@copyright 2016 Elphel, Inc.
@contact: andrey@elphel.coml
@license GPLv3.0+
@contact andrey@elphel.coml
Uses code from https://github.com/potentialventures/cocotb/blob/master/cocotb/drivers/amba.py
Uses code from https://github.com/potentialventures/cocotb/blob/master/cocotb/drivers/amba.py
Below are the copyright/license notices of the amba.py
Below are the copyright/license notices of the amba.py
...
...
py393/x393_mem.py
View file @
860b1594
...
@@ -80,7 +80,7 @@ class X393Mem(object):
...
@@ -80,7 +80,7 @@ class X393Mem(object):
try
:
try
:
X393_CLIENT
.
start
()
X393_CLIENT
.
start
()
except
:
except
:
print
(
"Failed to communicate to the server. Is it started? Swit
hching to dry t
un mode"
)
print
(
"Failed to communicate to the server. Is it started? Swit
ching to dry r
un mode"
)
X393_CLIENT
=
True
X393_CLIENT
=
True
...
@@ -170,7 +170,6 @@ class X393Mem(object):
...
@@ -170,7 +170,6 @@ class X393Mem(object):
@param quiet - reduce output
@param quiet - reduce output
"""
"""
if
X393_CLIENT
is
True
:
if
X393_CLIENT
is
True
:
# if self.DRY_MODE:
print
(
"simulated: write_mem(0x
%
x,0x
%
x)"
%
(
addr
,
data
))
print
(
"simulated: write_mem(0x
%
x,0x
%
x)"
%
(
addr
,
data
))
return
return
elif
not
X393_CLIENT
is
None
:
elif
not
X393_CLIENT
is
None
:
...
@@ -184,23 +183,11 @@ class X393Mem(object):
...
@@ -184,23 +183,11 @@ class X393Mem(object):
page_addr
=
addr
&
(
~
(
self
.
PAGE_SIZE
-
1
))
page_addr
=
addr
&
(
~
(
self
.
PAGE_SIZE
-
1
))
page_offs
=
addr
-
page_addr
page_offs
=
addr
-
page_addr
mm
=
self
.
wrap_mm
(
f
,
page_addr
)
mm
=
self
.
wrap_mm
(
f
,
page_addr
)
# if (page_addr>=0x80000000):
# page_addr-= (1<<32)
# mm = mmap.mmap(f.fileno(), self.PAGE_SIZE, offset=page_addr)
packedData
=
struct
.
pack
(
self
.
ENDIAN
+
"L"
,
data
)
packedData
=
struct
.
pack
(
self
.
ENDIAN
+
"L"
,
data
)
d
=
struct
.
unpack
(
self
.
ENDIAN
+
"L"
,
packedData
)[
0
]
d
=
struct
.
unpack
(
self
.
ENDIAN
+
"L"
,
packedData
)[
0
]
mm
[
page_offs
:
page_offs
+
4
]
=
packedData
mm
[
page_offs
:
page_offs
+
4
]
=
packedData
if
quiet
<
2
:
if
quiet
<
2
:
print
(
"0x
%08
x <== 0x
%08
x (
%
d)"
%
(
addr
,
d
,
d
))
print
(
"0x
%08
x <== 0x
%08
x (
%
d)"
%
(
addr
,
d
,
d
))
'''
if MONITOR_EMIO and VEBOSE:
gpio0=read_mem (0xe000a068)
gpio1=read_mem (0xe000a06c)
print("GPIO:
%04
x
%04
x
%04
x
%04
x"
%
(gpio1>>16, gpio1 & 0xffff, gpio0>>16, gpio0 & 0xffff))
if ((gpio0 & 0xc) != 0xc) or ((gpio0 & 0xff00) != 0):
print("******** AXI STUCK ************")
exit (0)
'''
def
read_mem
(
self
,
addr
,
quiet
=
1
):
def
read_mem
(
self
,
addr
,
quiet
=
1
):
'''
'''
...
...
x393_1_8_2.Doxyfile
View file @
860b1594
...
@@ -104,7 +104,7 @@ WARN_LOGFILE = log.txt
...
@@ -104,7 +104,7 @@ WARN_LOGFILE = log.txt
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
# Configuration options related to the input files
# Configuration options related to the input files
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
INPUT = . axi compressor_jp dsp includes logger memctrl sensor simulation_modules timing util_modules wrap x393_sata
py393
helpers
INPUT = . axi compressor_jp dsp includes logger memctrl sensor simulation_modules timing util_modules wrap x393_sata helpers
INPUT_ENCODING = UTF-8
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.v *.vh *.ucf *.qsf *.tcl *.py
FILE_PATTERNS = *.v *.vh *.ucf *.qsf *.tcl *.py
...
...
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