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
2f6e1d50
Commit
2f6e1d50
authored
Aug 27, 2020
by
Antoine Kaufmann
Browse files
libnicbm: nits
parent
4e277b38
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
libnicbm/include/nicbm.h
libnicbm/include/nicbm.h
+17
-8
No files found.
libnicbm/include/nicbm.h
View file @
2f6e1d50
...
@@ -8,14 +8,21 @@ extern "C" {
...
@@ -8,14 +8,21 @@ extern "C" {
static
const
size_t
MAX_DMA_LEN
=
2048
;
static
const
size_t
MAX_DMA_LEN
=
2048
;
struct
DMAOp
{
class
DMAOp
{
bool
write
;
public:
uint64_t
dma_addr
;
virtual
~
DMAOp
()
{
}
size_t
len
;
bool
write
;
void
*
data
;
uint64_t
dma_addr
;
size_t
len
;
void
*
data
;
};
};
/**
* The Runner drives the main simulation loop. It's initialized with a reference
* to a device it should manage, and then once `runMain` is called, it will
* start interacting with the PCI and Ethernet queue and forwarding calls to the
* device as needed.
* */
class
Runner
{
class
Runner
{
public:
public:
class
Device
{
class
Device
{
...
@@ -73,7 +80,7 @@ class Runner {
...
@@ -73,7 +80,7 @@ class Runner {
public:
public:
Runner
(
Device
&
dev_
);
Runner
(
Device
&
dev_
);
/** */
/**
Run the simulation
*/
int
runMain
(
int
argc
,
char
*
argv
[]);
int
runMain
(
int
argc
,
char
*
argv
[]);
/* these three are for `Runner::Device`. */
/* these three are for `Runner::Device`. */
...
@@ -82,7 +89,9 @@ class Runner {
...
@@ -82,7 +89,9 @@ class Runner {
void
eth_send
(
const
void
*
data
,
size_t
len
);
void
eth_send
(
const
void
*
data
,
size_t
len
);
};
};
/* Very simple device that just has one register size */
/**
* Very simple device that just has one register size.
*/
template
<
class
TReg
=
uint32_t
>
template
<
class
TReg
=
uint32_t
>
class
SimpleDevice
:
public
Runner
::
Device
{
class
SimpleDevice
:
public
Runner
::
Device
{
public:
public:
...
...
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