From abc76f20cb98c90e8dab416dd16dfd4a954013ba Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 23 Jul 2007 21:51:38 -0700 Subject: Major changes to how SimObjects are created and initialized. Almost all creation and initialization now happens in python. Parameter objects are generated and initialized by python. The .ini file is now solely for debugging purposes and is not used in construction of the objects in any way. --HG-- extra : convert_revision : 7e722873e417cb3d696f2e34c35ff488b7bff4ed --- src/dev/uart8250.cc | 39 ++++----------------------------------- 1 file changed, 4 insertions(+), 35 deletions(-) (limited to 'src/dev/uart8250.cc') diff --git a/src/dev/uart8250.cc b/src/dev/uart8250.cc index 50307aad4..9465eca57 100644 --- a/src/dev/uart8250.cc +++ b/src/dev/uart8250.cc @@ -43,7 +43,6 @@ #include "dev/platform.hh" #include "mem/packet.hh" #include "mem/packet_access.hh" -#include "sim/builder.hh" using namespace std; using namespace TheISA; @@ -100,12 +99,11 @@ Uart8250::IntrEvent::scheduleIntr() } -Uart8250::Uart8250(Params *p) +Uart8250::Uart8250(const Params *p) : Uart(p), IER(0), DLAB(0), LCR(0), MCR(0), lastTxInt(0), txIntrEvent(this, TX_INT), rxIntrEvent(this, RX_INT) { pioSize = 8; - } Tick @@ -338,37 +336,8 @@ Uart8250::unserialize(Checkpoint *cp, const std::string §ion) txIntrEvent.schedule(txintrwhen); } -BEGIN_DECLARE_SIM_OBJECT_PARAMS(Uart8250) - - Param pio_addr; - Param pio_latency; - SimObjectParam platform; - SimObjectParam sim_console; - SimObjectParam system; - -END_DECLARE_SIM_OBJECT_PARAMS(Uart8250) - -BEGIN_INIT_SIM_OBJECT_PARAMS(Uart8250) - - INIT_PARAM(pio_addr, "Device Address"), - INIT_PARAM_DFLT(pio_latency, "Programmed IO latency", 1000), - INIT_PARAM(platform, "platform"), - INIT_PARAM(sim_console, "The Simulator Console"), - INIT_PARAM(system, "system object") - -END_INIT_SIM_OBJECT_PARAMS(Uart8250) - -CREATE_SIM_OBJECT(Uart8250) +Uart8250 * +Uart8250Params::create() { - Uart8250::Params *p = new Uart8250::Params; - p->name = getInstanceName(); - p->pio_addr = pio_addr; - p->pio_delay = pio_latency; - p->platform = platform; - p->cons = sim_console; - p->system = system; - return new Uart8250(p); + return new Uart8250(this); } - -REGISTER_SIM_OBJECT("Uart8250", Uart8250) - -- cgit v1.2.3