diff options
author | Gabe Black <gabeblack@google.com> | 2017-06-03 05:03:18 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2017-06-03 15:23:46 +0000 |
commit | 2ce045341b73166cad2ef95b37c87d8d4c590d80 (patch) | |
tree | eb46ce8c910cd04d39477da459915802105c5729 /src/dev/net/Ethernet.py | |
parent | f9ad4066d71748829c11868b5b92ba092ee9513b (diff) | |
download | gem5-2ce045341b73166cad2ef95b37c87d8d4c590d80.tar.xz |
dev: Refactor the EtherTapStub to make room for using tap.
A lot of the implementation of EtherTapStub can be shared with a version
which uses a tap device directly. This change factors out those parts to
accommodate that.
Change-Id: I9c2e31f1be139ca73859a83f05457cef90101006
Reviewed-on: https://gem5-review.googlesource.com/3645
Reviewed-by: Nathan Binkert <nate@binkert.org>
Maintainer: Nathan Binkert <nate@binkert.org>
Diffstat (limited to 'src/dev/net/Ethernet.py')
-rw-r--r-- | src/dev/net/Ethernet.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/dev/net/Ethernet.py b/src/dev/net/Ethernet.py index 1f8e75200..68867c00f 100644 --- a/src/dev/net/Ethernet.py +++ b/src/dev/net/Ethernet.py @@ -95,13 +95,18 @@ class EtherSwitch(EtherObject): delay_var = Param.Latency('0ns', "packet transmit delay variability") time_to_live = Param.Latency('10ms', "time to live of MAC address maping") -class EtherTapStub(EtherObject): - type = 'EtherTapStub' +class EtherTapBase(EtherObject): + type = 'EtherTapBase' + abstract = True cxx_header = "dev/net/ethertap.hh" bufsz = Param.Int(10000, "tap buffer size") dump = Param.EtherDump(NULL, "dump object") + tap = SlavePort("Ethernet interface to connect to gem5's network") + +class EtherTapStub(EtherTapBase): + type = 'EtherTapStub' + cxx_header = "dev/net/ethertap.hh" port = Param.UInt16(3500, "Port helper should send packets to") - tap = SlavePort("Ethernet interface to gem5's network") class EtherDump(SimObject): type = 'EtherDump' |