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
f5e6109a
Commit
f5e6109a
authored
Jan 25, 2022
by
Jialin Li
Browse files
Merge branch 'master' of github.com:simbricks/simbricks
parents
b47c95cb
c132bf27
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
0 deletions
+99
-0
sims/nic/e1000_gem5/rules.mk
sims/nic/e1000_gem5/rules.mk
+34
-0
sims/nic/e1000_gem5/support.h
sims/nic/e1000_gem5/support.h
+64
-0
sims/nic/rules.mk
sims/nic/rules.mk
+1
-0
No files found.
sims/nic/e1000_gem5/rules.mk
0 → 100644
View file @
f5e6109a
# Copyright 2021 Max Planck Institute for Software Systems, and
# National University of Singapore
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
include
mk/subdir_pre.mk
bin_e1000_gem5
:=
$(d)
e1000_gem5
OBJS
:=
$(
addprefix
$(d)
,e1000_gem5.o i8254xGBe.o gem5/bitfield.o gem5/inet.o
\
gem5/pktfifo.o
)
$(bin_e1000_gem5)
:
$(OBJS) $(lib_nicbm) $(lib_nicif)
CLEAN
:=
$(bin_e1000_gem5)
$(OBJS)
ALL
:=
$(bin_e1000_gem5)
include
mk/subdir_post.mk
sims/nic/e1000_gem5/support.h
0 → 100644
View file @
f5e6109a
#ifndef SIMS_NIC_E1000_GEM5_SUPPORT_H_
#define SIMS_NIC_E1000_GEM5_SUPPORT_H_
#include <arpa/inet.h>
#include <functional>
#include <memory>
#include <simbricks/nicbm/nicbm.h>
#define DNET_LIL_ENDIAN 42
#define DNET_BYTESEX DNET_LIL_ENDIAN
//#define DEBUG_E1000
#ifdef DEBUG_E1000
# define DPRINTF(x,y...) fprintf(stderr, #x ": " y)
#else
# define DPRINTF(x,y...) do { } while (0)
#endif
typedef
uint64_t
Addr
;
typedef
uint64_t
Tick
;
#define ETH_ADDR_LEN 6
class
Gem5TimerEv
;
class
EthPacketData
{
public:
unsigned
length
;
uint8_t
*
data
;
EthPacketData
(
unsigned
len
)
:
length
(
0
),
data
(
new
uint8_t
[
len
])
{
}
~
EthPacketData
()
{
delete
[]
data
;
}
};
typedef
std
::
shared_ptr
<
EthPacketData
>
EthPacketPtr
;
class
EventFunctionWrapper
:
public
nicbm
::
TimedEvent
{
public:
bool
sched
;
std
::
function
<
void
(
void
)
>
callback
;
std
::
string
_name
;
EventFunctionWrapper
(
const
std
::
function
<
void
(
void
)
>
&
callback
,
const
std
::
string
&
name
)
:
sched
(
false
),
callback
(
callback
),
_name
(
name
)
{
}
virtual
~
EventFunctionWrapper
()
=
default
;
bool
scheduled
()
{
return
sched
;
}
};
static
inline
uint16_t
htobe
(
uint16_t
x
)
{
return
htons
(
x
);
}
static
inline
uint16_t
htole
(
uint16_t
x
)
{
return
x
;
}
void
warn
(
const
char
*
fmt
,
...);
void
panic
(
const
char
*
fmt
,
...);
#endif // SIMS_NIC_E1000_GEM5_SUPPORT_H_
\ No newline at end of file
sims/nic/rules.mk
View file @
f5e6109a
...
...
@@ -24,6 +24,7 @@ include mk/subdir_pre.mk
$(eval
$(call
subdir,corundum))
$(eval
$(call
subdir,corundum_bm))
$(eval
$(call
subdir,e1000_gem5))
$(eval
$(call
subdir,i40e_bm))
include
mk/subdir_post.mk
Prev
1
2
Next
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