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
Commits
f3a6a98b
Commit
f3a6a98b
authored
1 year ago
by
dwf1m12
Browse files
Options
Downloads
Patches
Plain Diff
fix hex-digit string handling in testbench file upload
parent
8f02db36
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
verif/trace/verilog/nanosoc_axi_stream_io_8_txd_from_file.v
+27
-5
27 additions, 5 deletions
verif/trace/verilog/nanosoc_axi_stream_io_8_txd_from_file.v
with
27 additions
and
5 deletions
verif/trace/verilog/nanosoc_axi_stream_io_8_txd_from_file.v
+
27
−
5
View file @
f3a6a98b
...
...
@@ -27,6 +27,28 @@ module nanosoc_axi_stream_io_8_txd_from_file
output
wire
[
7
:
0
]
txd8_data
);
function
[
7
:
0
]
FNmap_hex_digit
;
input
[
3
:
0
]
nibble
;
case
(
nibble
[
3
:
0
])
4'b0000
:
FNmap_hex_digit
=
"0"
&
8'hff
;
4'b0001
:
FNmap_hex_digit
=
"1"
&
8'hff
;
4'b0010
:
FNmap_hex_digit
=
"2"
&
8'hff
;
4'b0011
:
FNmap_hex_digit
=
"3"
&
8'hff
;
4'b0100
:
FNmap_hex_digit
=
"4"
&
8'hff
;
4'b0101
:
FNmap_hex_digit
=
"5"
&
8'hff
;
4'b0110
:
FNmap_hex_digit
=
"6"
&
8'hff
;
4'b0111
:
FNmap_hex_digit
=
"7"
&
8'hff
;
4'b1000
:
FNmap_hex_digit
=
"8"
&
8'hff
;
4'b1001
:
FNmap_hex_digit
=
"9"
&
8'hff
;
4'b1010
:
FNmap_hex_digit
=
"a"
&
8'hff
;
4'b1011
:
FNmap_hex_digit
=
"b"
&
8'hff
;
4'b1100
:
FNmap_hex_digit
=
"c"
&
8'hff
;
4'b1101
:
FNmap_hex_digit
=
"d"
&
8'hff
;
4'b1110
:
FNmap_hex_digit
=
"e"
&
8'hff
;
4'b1111
:
FNmap_hex_digit
=
"f"
&
8'hff
;
//default: FNmap_hex_digit = "0" & 8'hff;
endcase
endfunction
//----------------------------------------------
//-- File I/O
...
...
@@ -84,11 +106,11 @@ localparam BUFSIZE = (64 * 1024);
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
[
14
]
=
FNmap_hex_digit
(
codesize
[
19
:
16
]
)
;
//
adpbuf
[
15
]
=
FNmap_hex_digit
(
codesize
[
15
:
12
]
)
;
//
adpbuf
[
16
]
=
FNmap_hex_digit
(
codesize
[
11
:
8
]
)
;
//
adpbuf
[
17
]
=
FNmap_hex_digit
(
codesize
[
7
:
4
]
)
;
//
adpbuf
[
18
]
=
FNmap_hex_digit
(
codesize
[
3
:
0
]
)
;
//
adpbuf
[
19
]
=
8'h0a
;
// newline
$
readmemh
(
CODEFILENAME
,
adpbuf
,
20
);
adpbuf
[
clen
+
20
]
=
"C"
;
// control
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment