Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
3b8c348b
Commit
3b8c348b
authored
Jun 11, 2020
by
Antoine Kaufmann
Browse files
corundum: attempt to fix RX
parent
4e704902
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
corundum/corundum_verilator.cpp
corundum/corundum_verilator.cpp
+8
-6
No files found.
corundum/corundum_verilator.cpp
View file @
3b8c348b
...
@@ -19,7 +19,7 @@ struct DMAOp;
...
@@ -19,7 +19,7 @@ struct DMAOp;
static
volatile
int
exiting
=
0
;
static
volatile
int
exiting
=
0
;
static
uint64_t
main_time
=
0
;
static
uint64_t
main_time
=
0
;
static
VerilatedVcdC
*
trace
;
//
static VerilatedVcdC* trace;
...
@@ -646,25 +646,27 @@ class EthernetRx {
...
@@ -646,25 +646,27 @@ class EthernetRx {
// done with packet
// done with packet
std
::
cerr
<<
"EthernetRx: finished packet"
<<
std
::
endl
;
std
::
cerr
<<
"EthernetRx: finished packet"
<<
std
::
endl
;
top
.
rx_axis_tvalid
=
0
;
top
.
rx_axis_tvalid
=
0
;
top
.
rx_axis_tlast
=
0
;
packet_off
=
packet_len
=
0
;
packet_off
=
packet_len
=
0
;
}
else
{
}
else
{
// put out more packet data
// put out more packet data
std
::
cerr
<<
"EthernetRx: push flit "
<<
packet_off
<<
std
::
endl
;
std
::
cerr
<<
"EthernetRx: push flit "
<<
packet_off
<<
std
::
endl
;
top
.
rx_axis_tkeep
=
0
;
top
.
rx_axis_tkeep
=
0
;
top
.
rx_axis_tdata
=
0
;
top
.
rx_axis_tdata
=
0
;
for
(
size_t
i
=
0
;
i
<
8
&&
packet_off
<
packet_len
;
i
++
)
{
for
(
size_t
i
=
0
;
i
<
8
&&
packet_off
<
packet_len
;
i
++
)
{
top
.
rx_axis_tdata
|=
top
.
rx_axis_tdata
|=
((
uint64_t
)
packet_buf
[
packet_off
])
<<
(
i
*
8
);
((
uint64_t
)
packet_buf
[
packet_off
])
<<
(
i
*
8
);
top
.
rx_axis_tkeep
|=
(
1
<<
i
);
top
.
rx_axis_tkeep
|=
(
1
<<
i
);
packet_off
++
;
packet_off
++
;
}
}
top
.
rx_axis_tvalid
=
1
;
top
.
rx_axis_tlast
=
(
packet_off
==
packet_len
);
top
.
rx_axis_tlast
=
(
packet_off
==
packet_len
);
}
}
trace
->
dump
(
main_time
);
//
trace->dump(main_time);
}
else
{
}
else
{
// no data
// no data
top
.
rx_axis_tvalid
=
0
;
top
.
rx_axis_tvalid
=
0
;
top
.
rx_axis_tlast
=
0
;
}
}
}
}
...
@@ -755,9 +757,9 @@ int main(int argc, char *argv[])
...
@@ -755,9 +757,9 @@ int main(int argc, char *argv[])
Vinterface
*
top
=
new
Vinterface
;
Vinterface
*
top
=
new
Vinterface
;
trace
=
new
VerilatedVcdC
;
/*
trace = new VerilatedVcdC;
top->trace(trace, 99);
top->trace(trace, 99);
trace
->
open
(
"debug.vcd"
);
trace->open("debug.vcd");
*/
MemWritePort
p_mem_write_ctrl_dma
(
MemWritePort
p_mem_write_ctrl_dma
(
top
->
ctrl_dma_ram_wr_cmd_sel
,
top
->
ctrl_dma_ram_wr_cmd_sel
,
...
@@ -895,7 +897,7 @@ int main(int argc, char *argv[])
...
@@ -895,7 +897,7 @@ int main(int argc, char *argv[])
}
}
report_outputs
(
top
);
report_outputs
(
top
);
trace
->
close
();
//
trace->close();
top
->
final
();
top
->
final
();
delete
top
;
delete
top
;
return
0
;
return
0
;
...
...
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