Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
NanoSoC Tech
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SoCLabs
NanoSoC Tech
Compare revisions
b72b2499c7cca726c8fbc9d27b33e0f65f1cb6cd to ec4ed910f6e7d262a243688edf89b4fb7068f22a
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
soclabs/nanosoc_tech
Select target project
No results found
ec4ed910f6e7d262a243688edf89b4fb7068f22a
Select Git revision
Branches
dev
feat_accel_decouple
feat_accel_hash_stream
feat_dma230_dataio
feat_dma350
feat_dmax4
feat_extio
feat_nanosoc_regions
feat_qspi_rom
main
Tags
nanosoc-2023
11 results
Swap
Target
soclabs/nanosoc_tech
Select target project
soclabs/nanosoc_tech
1 result
b72b2499c7cca726c8fbc9d27b33e0f65f1cb6cd
Select Git revision
Branches
dev
feat_accel_decouple
feat_accel_hash_stream
feat_dma230_dataio
feat_dma350
feat_dmax4
feat_extio
feat_nanosoc_regions
feat_qspi_rom
main
Tags
nanosoc-2023
11 results
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (1)
add code preload to ADP stream palyback ready for netlist
· ec4ed910
dwf1m12
authored
1 year ago
ec4ed910
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
verif/tb/verilog/nanosoc_tb.v
+9
-9
9 additions, 9 deletions
verif/tb/verilog/nanosoc_tb.v
verif/trace/verilog/nanosoc_axi_stream_io_8_txd_from_file.v
+79
-11
79 additions, 11 deletions
verif/trace/verilog/nanosoc_axi_stream_io_8_txd_from_file.v
with
88 additions
and
20 deletions
verif/tb/verilog/nanosoc_tb.v
View file @
ec4ed910
...
...
@@ -363,15 +363,15 @@ nanosoc_ft1248x1_track
`endif
`ifndef
COCOTB_SIM
nanosoc_uart_capture
#(.
LOGFILENAME
(
"logs/ft1248_ip.log"
))
u_nanosoc_uart_capture2
(
.
RESETn
(
NRST
),
.
CLK
(
ft_clk2uart
),
.
RXD
(
ft_txd2uart
),
.
DEBUG_TESTER_ENABLE
(
),
.
SIMULATIONEND
(),
// This signal set to 1 at the end of simulation.
.
AUXCTRL
()
);
//
nanosoc_uart_capture #(.LOGFILENAME("logs/ft1248_ip.log"))
//
u_nanosoc_uart_capture2(
//
.RESETn (NRST),
//
.CLK (ft_clk2uart),
//
.RXD (ft_txd2uart),
//
.DEBUG_TESTER_ENABLE ( ),
//
.SIMULATIONEND (), // This signal set to 1 at the end of simulation.
//
.AUXCTRL ()
//
);
`endif
// --------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
verif/trace/verilog/nanosoc_axi_stream_io_8_txd_from_file.v
View file @
ec4ed910
//-----------------------------------------------------------------------------
// customised example
Cortex-M0
controller
UART
with
fil
e lo
gging
// customised example
ADP i/o stream
controller
(
with
cod
e lo
ader for netlist)
// A joint work commissioned on behalf of SoC Labs, under Arm Academic Access license.
//
// Contributors
...
...
@@ -16,7 +16,8 @@
module
nanosoc_axi_stream_io_8_txd_from_file
#(
parameter
TXDFILENAME
=
"txd.cmd"
,
#(
parameter
TXDFILENAME
=
"adp.cmd"
,
parameter
CODEFILENAME
=
"image.hex"
,
parameter
VERBOSE
=
0
)
(
input
wire
aclk
,
...
...
@@ -34,33 +35,100 @@ module nanosoc_axi_stream_io_8_txd_from_file
integer
fd
;
// channel descriptor for cmd file input
integer
ch
;
integer
flen
;
integer
clen
;
reg
[
31
:
0
]
codesize
;
integer
fp
;
`define
EOF
-
1
reg
valid
;
reg
[
7
:
0
]
data8
;
localparam
BUFSIZE
=
(
64
*
1024
);
reg
[
7
:
0
]
adpbuf
[
0
:
BUFSIZE
-
1
];
initial
begin
valid
<=
0
;
// $timeformat(-9, 0, " ns", 14);
flen
=
0
;
fd
=
$
fopen
(
CODEFILENAME
,
"r"
);
$
write
(
"** %m : input file : <%s> **
\n
"
,
CODEFILENAME
);
if
(
fd
==
0
)
$
write
(
"** %m : input file <%s> failed to open **
\n
"
,
CODEFILENAME
);
else
begin
while
(
!
$
feof
(
fd
))
begin
ch
=
$
fgetc
(
fd
);
flen
=
flen
+
1
;
end
if
(
flen
>
0
)
flen
=
flen
-
1
;
// correct for extra char count(???)
clen
=
(
flen
/
3
);
codesize
=
clen
[
31
:
0
];
$
write
(
"** %m : flen: %d , codesize(flen/3): %d [0x%h]) **
\n
"
,
flen
,
clen
,
codesize
);
$
fclose
(
fd
);
end
// now build adp buffer
adpbuf
[
0
]
=
8'h1b
;
// <ESC> - enter ADP monitor
adpbuf
[
1
]
=
"A"
;
// set address pointer
adpbuf
[
2
]
=
" "
;
// to 0x20000000
adpbuf
[
3
]
=
"2"
;
//
adpbuf
[
4
]
=
"0"
;
//
adpbuf
[
5
]
=
"0"
;
//
adpbuf
[
6
]
=
"0"
;
//
adpbuf
[
7
]
=
"0"
;
//
adpbuf
[
8
]
=
"0"
;
//
adpbuf
[
9
]
=
"0"
;
//
adpbuf
[
10
]
=
"0"
;
//
adpbuf
[
11
]
=
8'h0a
;
// newline
adpbuf
[
12
]
=
"U"
;
// set upload filesize (N bytes)
adpbuf
[
13
]
=
" "
;
// only up to 1Mbyte for now!
adpbuf
[
14
]
=
"0"
+
codesize
[
19
:
16
];
//
adpbuf
[
15
]
=
"0"
+
codesize
[
15
:
12
];
//
adpbuf
[
16
]
=
"0"
+
codesize
[
11
:
8
];
//
adpbuf
[
17
]
=
"0"
+
codesize
[
7
:
4
];
//
adpbuf
[
18
]
=
"0"
+
codesize
[
3
:
0
];
//
adpbuf
[
19
]
=
8'h0a
;
// newline
$
readmemh
(
CODEFILENAME
,
adpbuf
,
20
);
adpbuf
[
clen
+
20
]
=
"C"
;
// control
adpbuf
[
clen
+
21
]
=
" "
;
adpbuf
[
clen
+
22
]
=
"2"
;
// (gpio bit set)
adpbuf
[
clen
+
23
]
=
"0"
;
adpbuf
[
clen
+
24
]
=
"1"
;
// assert reset to reboot
adpbuf
[
clen
+
25
]
=
8'h0a
;
// newline
// append any ADP command file to the code memory preload
flen
=
0
;
fd
=
$
fopen
(
TXDFILENAME
,
"r"
);
$
write
(
"** %m : input file : <%s> **
\n
"
,
TXDFILENAME
);
if
(
fd
==
0
)
$
write
(
"** %m : input file failed to open **
\n
"
);
$
write
(
"** %m : input file
<%s>
failed to open **
\n
"
,
TXDFILENAME
);
else
begin
while
(
!
$
feof
(
fd
))
begin
adpbuf
[
clen
+
25
+
flen
]
<=
$
fgetc
(
fd
);
flen
=
flen
+
1
;
end
$
write
(
"** %m : file closed after stream TX completed **
\n
"
);
$
fclose
(
fd
);
end
if
(
flen
>
0
)
flen
=
flen
-
1
;
// correct for extra char count(???)
// now output the entire adp buffer to the stream
flen
=
flen
+
clen
+
25
+
1
;
fp
=
0
;
valid
<=
0
;
begin
@
(
posedge
aresetn
);
ch
=
$
fgetc
(
fd
);
while
(
ch
!=
`EOF
)
begin
while
(
fp
<
flen
)
begin
@
(
posedge
aclk
);
data8
<=
(
ch
&
8'hff
);
data8
<=
adpbuf
[
fp
];
fp
=
fp
+
1
;
valid
<=
1'b1
;
@
(
posedge
aclk
);
while
(
txd8_ready
==
1'b0
)
@
(
posedge
aclk
);
valid
<=
0
;
ch
=
$
fgetc
(
fd
);
end
$
write
(
"** %m : file closed after stream TX completed **
\n
"
);
$
fclose
(
fd
);
$
write
(
"** %m : adpbuf replay completed **
\n
"
);
valid
<=
0
;
end
end
...
...
This diff is collapsed.
Click to expand it.