Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- src/at90canbase.cpp | 2 +- src/atmega1284abase.cpp | 2 +- src/atmega668base.cpp | 2 +- src/avrdevice.cpp | 16 ++++++++-------- src/decoder.cpp | 24 ++++++++++++------------ src/flashprog.cpp | 3 +-- src/hwacomp.cpp | 8 ++++---- src/hwad.cpp | 4 ++-- src/hwad.h | 7 ++++--- src/hwstack.cpp | 8 ++++---- src/hwtimer/hwtimer.cpp | 16 ++++++++-------- src/hwtimer/timerirq.cpp | 2 +- src/hwtimer/timerprescaler.cpp | 12 ++++++------ src/ioregs.cpp | 4 ++-- src/irqsystem.cpp | 6 +++--- src/rwmem.cpp | 14 +++++++------- src/rwmem.h | 4 ++-- src/traceval.cpp | 10 +++++----- 18 files changed, 72 insertions(+), 72 deletions(-)
diff --git a/src/at90canbase.cpp b/src/at90canbase.cpp index b499274..d05f13c 100644 --- a/src/at90canbase.cpp +++ b/src/at90canbase.cpp @@ -83,8 +83,8 @@ AvrDevice_at90canbase::AvrDevice_at90canbase(unsigned ram_bytes, porte(this, "E", true), portf(this, "F", true), portg(this, "G", true), - assr_reg(&coreTraceGroup, "ASSR"), gtccr_reg(&coreTraceGroup, "GTCCR"), + assr_reg(&coreTraceGroup, "ASSR"), prescaler013(this, "01", >ccr_reg, 0, 7), prescaler2(this, "2", PinAtPort(&portc, 7), &assr_reg, 5, >ccr_reg, 1, 7) { flagELPMInstructions = true; diff --git a/src/atmega1284abase.cpp b/src/atmega1284abase.cpp index b358efc..b12ecd9 100644 --- a/src/atmega1284abase.cpp +++ b/src/atmega1284abase.cpp @@ -88,8 +88,8 @@ AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(unsigned ram_bytes, portb(this, "B", true), portc(this, "C", true), portd(this, "D", true), - assr_reg(&coreTraceGroup, "ASSR"), gtccr_reg(&coreTraceGroup, "GTCCR"), + assr_reg(&coreTraceGroup, "ASSR"), prescaler01(this, "01", >ccr_reg, 0, 7), prescaler2(this, "2", PinAtPort(&portb, 6), &assr_reg, 5, >ccr_reg, 1, 7) { diff --git a/src/atmega668base.cpp b/src/atmega668base.cpp index b193c76..4cf6c9f 100644 --- a/src/atmega668base.cpp +++ b/src/atmega668base.cpp @@ -82,8 +82,8 @@ AvrDevice_atmega668base::AvrDevice_atmega668base(unsigned ram_bytes, portb(this, "B", true), portc(this, "C", true, 7), portd(this, "D", true), - assr_reg(&coreTraceGroup, "ASSR"), gtccr_reg(&coreTraceGroup, "GTCCR"), + assr_reg(&coreTraceGroup, "ASSR"), prescaler01(this, "01", >ccr_reg, 0, 7), prescaler2(this, "2", PinAtPort(&portb, 6), &assr_reg, 5, >ccr_reg, 1, 7) { diff --git a/src/avrdevice.cpp b/src/avrdevice.cpp index 37b236d..e988c73 100644 --- a/src/avrdevice.cpp +++ b/src/avrdevice.cpp @@ -126,12 +126,16 @@ AvrDevice::AvrDevice(unsigned int _ioSpaceSize, unsigned int ERamSize, unsigned int flashSize): TraceValueRegister(), - coreTraceGroup(this), - abortOnInvalidAccess(false), + ioSpaceSize(_ioSpaceSize), iRamSize(IRamSize), eRamSize(ERamSize), - ioSpaceSize(_ioSpaceSize), devSignature(-1), + abortOnInvalidAccess(false), + coreTraceGroup(this), + deferIrq(false), + newIrqPc(0xffffffff), + v_supply(5.0), // assume 5V supply voltage + v_bandgap(1.1), // assume a bandgap ref unit with 1.1V flagIWInstructions(true), flagJMPInstructions(true), flagIJMPInstructions(true), @@ -142,11 +146,7 @@ AvrDevice::AvrDevice(unsigned int _ioSpaceSize, flagMOVWInstruction(true), flagTiny10(false), flagTiny1x(false), - flagXMega(false), - deferIrq(false), - newIrqPc(0xffffffff), - v_supply(5.0), // assume 5V supply voltage - v_bandgap(1.1) // assume a bandgap ref unit with 1.1V + flagXMega(false) { dump_manager = DumpManager::Instance(); dump_manager->registerAvrDevice(this); diff --git a/src/decoder.cpp b/src/decoder.cpp index f560ed7..2a4c839 100644 --- a/src/decoder.cpp +++ b/src/decoder.cpp @@ -206,8 +206,8 @@ int avr_op_AND::operator()() { avr_op_ANDI::avr_op_ANDI(word opcode, AvrDevice *c): DecodedInstruction(c), R1(get_rd_4(opcode)), - status(c->status), - K(get_K_8(opcode)) {} + K(get_K_8(opcode)), + status(c->status) {} int avr_op_ANDI::operator()() { unsigned char rd = core->GetCoreReg(R1); @@ -330,8 +330,8 @@ int avr_op_BSET::operator()() { avr_op_BST::avr_op_BST(word opcode, AvrDevice *c): DecodedInstruction(c), R1(get_rd_5(opcode)), - status(c->status), - Kbit(get_reg_bit(opcode)) {} + Kbit(get_reg_bit(opcode)), + status(c->status) {} int avr_op_BST::operator()() { status->T = ((core->GetCoreReg(R1) & (1 << Kbit)) != 0); @@ -440,8 +440,8 @@ int avr_op_CPC::operator()() { avr_op_CPI::avr_op_CPI(word opcode, AvrDevice *c): DecodedInstruction(c), R1(get_rd_4(opcode)), - status(c->status), - K(get_K_8(opcode)) {} + K(get_K_8(opcode)), + status(c->status) {} int avr_op_CPI::operator()() { byte rd = core->GetCoreReg(R1); @@ -1153,8 +1153,8 @@ int avr_op_OR::operator()() { avr_op_ORI::avr_op_ORI(word opcode, AvrDevice *c): DecodedInstruction(c), R1(get_rd_4(opcode)), - status(c->status), - K(get_K_8(opcode)) {} + K(get_K_8(opcode)), + status(c->status) {} int avr_op_ORI::operator()() { byte res = core->GetCoreReg(R1) | K; @@ -1303,8 +1303,8 @@ int avr_op_SBC::operator()() { avr_op_SBCI::avr_op_SBCI(word opcode, AvrDevice *c): DecodedInstruction(c), R1(get_rd_4(opcode)), - status(c->status), - K(get_K_8(opcode)) {} + K(get_K_8(opcode)), + status(c->status) {} unsigned char avr_op_SBCI::GetModifiedR() const { return R1; @@ -1397,8 +1397,8 @@ int avr_op_SBIS::operator()() { avr_op_SBIW::avr_op_SBIW(word opcode, AvrDevice *c): DecodedInstruction(c), R1(get_rd_2(opcode)), - status(c->status), - K(get_K_6(opcode)) {} + K(get_K_6(opcode)), + status(c->status) {} unsigned char avr_op_SBIW::GetModifiedR() const { return R1; diff --git a/src/flashprog.cpp b/src/flashprog.cpp index 233f37f..1f66681 100644 --- a/src/flashprog.cpp +++ b/src/flashprog.cpp @@ -54,7 +54,6 @@ FlashProgramming::FlashProgramming(AvrDevice *c, unsigned int nrww, int mode): Hardware(c), - core(c), pageSize(pgsz), nrww_addr(nrww), spmcr_reg(c, "SPMCR", @@ -235,8 +234,8 @@ AvrFuses::AvrFuses(void): fuseBits(0xfffffffd), nrwwAddr(0), nrwwSize(0), - bitPosBOOTRST(-1), bitPosBOOTSZ(-1), + bitPosBOOTRST(-1), flagBOOTRST(true), valueBOOTSZ(0) { diff --git a/src/hwacomp.cpp b/src/hwacomp.cpp index a692d40..af9d2d4 100644 --- a/src/hwacomp.cpp +++ b/src/hwacomp.cpp @@ -44,15 +44,15 @@ HWAcomp::HWAcomp(AvrDevice *core, irqSystem(irqsys), pinAin0(ain0), pinAin1(ain1), - acsr_reg(this, "ACSR", this, &HWAcomp::GetAcsr, &HWAcomp::SetAcsr), + useBG(_useBG), + acme_sfior(false), + enabled(true), irqVec(_irqVec), timerA(_timerA), timerB(_timerB), - enabled(true), - useBG(_useBG), ad(_ad), sfior(_sfior), - acme_sfior(false) + acsr_reg(this, "ACSR", this, &HWAcomp::GetAcsr, &HWAcomp::SetAcsr) { // just check right assignment of IRQ vector number irqSystem->DebugVerifyInterruptVector(irqVec, this); diff --git a/src/hwad.cpp b/src/hwad.cpp index aba970b..343c928 100644 --- a/src/hwad.cpp +++ b/src/hwad.cpp @@ -302,12 +302,12 @@ HWAd::HWAd(AvrDevice *c, int _typ, HWIrqSystem *i, unsigned int iv, HWAdmux *a, Hardware(c), TraceValueRegister(c, "AD"), adType(_typ), - notifyClient(NULL), core(c), mux(a), - irqSystem(i), aref(r), + irqSystem(i), irqVec(iv), + notifyClient(NULL), adch_reg(this, "ADCH", this, &HWAd::GetAdch, 0), adcl_reg(this, "ADCL", this, &HWAd::GetAdcl, 0), adcsra_reg(this, "ADCSRA", this, &HWAd::GetAdcsrA, &HWAd::SetAdcsrA), diff --git a/src/hwad.h b/src/hwad.h index b088253..005ad9b 100644 --- a/src/hwad.h +++ b/src/hwad.h @@ -97,10 +97,11 @@ class HWAdmux: public HasPinNotifyFunction { AvrDevice *core; public: - HWAdmux(AvrDevice* _core, int _pins): core(_core), - numPins(_pins), + HWAdmux(AvrDevice* _core, int _pins): notifyClient(0), muxSelect(0), - notifyClient(0) { } + numPins(_pins), + core(_core) { } + virtual ~HWAdmux() { } virtual float GetValue(int select, float vcc) = 0; diff --git a/src/hwstack.cpp b/src/hwstack.cpp index c28bf17..95203e4 100644 --- a/src/hwstack.cpp +++ b/src/hwstack.cpp @@ -33,8 +33,8 @@ using namespace std; HWStack::HWStack(AvrDevice *c): - m_ThreadList(*c), - core(c) { + core(c), + m_ThreadList(*c) { Reset(); } @@ -62,11 +62,11 @@ void HWStack::SetReturnPoint(unsigned long stackPointer, Funktor *f) { HWStackSram::HWStackSram(AvrDevice *c, int bs, bool initRE): HWStack(c), TraceValueRegister(c, "STACK"), + initRAMEND(initRE), sph_reg(this, "SPH", this, &HWStackSram::GetSph, &HWStackSram::SetSph), spl_reg(this, "SPL", - this, &HWStackSram::GetSpl, &HWStackSram::SetSpl), - initRAMEND(initRE) { + this, &HWStackSram::GetSpl, &HWStackSram::SetSpl) { stackCeil = 1 << bs; // TODO: The number of bits is unable to acurately represent 0x460 ceiling of ATmega8: has 1024 B RAM (0x400) and 32+64 (0x60) registers. Reset(); } diff --git a/src/hwtimer/hwtimer.cpp b/src/hwtimer/hwtimer.cpp index 691f9b1..3f9f5fe 100644 --- a/src/hwtimer/hwtimer.cpp +++ b/src/hwtimer/hwtimer.cpp @@ -1093,11 +1093,11 @@ HWTimer16_2C2::HWTimer16_2C2(AvrDevice *core, ICaptureSource* icapsrc, bool is_at8515): HWTimer16(core, p, unit, tov, tcompA, outA, tcompB, outB, NULL, NULL, ticap, icapsrc), + at8515_mode(is_at8515), tccra_reg(this, "TCCRA", this, &HWTimer16_2C2::Get_TCCRA, &HWTimer16_2C2::Set_TCCRA), tccrb_reg(this, "TCCRB", - this, &HWTimer16_2C2::Get_TCCRB, &HWTimer16_2C2::Set_TCCRB), - at8515_mode(is_at8515) {} + this, &HWTimer16_2C2::Get_TCCRB, &HWTimer16_2C2::Set_TCCRB) { } void HWTimer16_2C2::Set_WGM(int val) { if(wgm_raw != val) { @@ -1307,7 +1307,12 @@ HWTimerTinyX5::HWTimerTinyX5(AvrDevice *core, PinAtPort* ocrb_outinv): Hardware(core), TraceValueRegister(core, "TIMER1"), + ocra_unit(ocra_out, ocra_outinv), + ocrb_unit(ocrb_out, ocrb_outinv), core(core), + timerOverflowInt(tov), + timerOCRAInt(tocra), + timerOCRBInt(tocrb), tccr_reg(this, "TCCR1", this, &HWTimerTinyX5::Get_TCCR, &HWTimerTinyX5::Set_TCCR), tcnt_reg(this, "TCNT1", @@ -1323,12 +1328,7 @@ HWTimerTinyX5::HWTimerTinyX5(AvrDevice *core, dt1a_reg(this, "DT1A", this, &HWTimerTinyX5::Get_DT1A, &HWTimerTinyX5::Set_DT1A), dt1b_reg(this, "DT1B", - this, &HWTimerTinyX5::Get_DT1B, &HWTimerTinyX5::Set_DT1B), - timerOverflowInt(tov), - timerOCRAInt(tocra), - timerOCRBInt(tocrb), - ocra_unit(ocra_out, ocra_outinv), - ocrb_unit(ocrb_out, ocrb_outinv) + this, &HWTimerTinyX5::Get_DT1B, &HWTimerTinyX5::Set_DT1B) { // gtccr and pllcsr register gtccrRegister = gtccr; diff --git a/src/hwtimer/timerirq.cpp b/src/hwtimer/timerirq.cpp index 790a76b..9e7315d 100644 --- a/src/hwtimer/timerirq.cpp +++ b/src/hwtimer/timerirq.cpp @@ -64,8 +64,8 @@ TimerIRQRegister::TimerIRQRegister(AvrDevice* c, int regidx): Hardware(c), TraceValueRegister(c, __hlp2scope("TMRIRQ", regidx)), - core(c), irqsystem(irqsys), + core(c), lines(8), timsk_reg(this, __hlp2name("TIMSK", regidx)), tifr_reg(this, __hlp2name("TIFR", regidx)) diff --git a/src/hwtimer/timerprescaler.cpp b/src/hwtimer/timerprescaler.cpp index eddee78..7ece9e2 100644 --- a/src/hwtimer/timerprescaler.cpp +++ b/src/hwtimer/timerprescaler.cpp @@ -28,9 +28,9 @@ HWPrescaler::HWPrescaler(AvrDevice *core, const std::string &tracename): Hardware(core), - countEnable(true), _resetBit(-1), - _resetSyncBit(-1) + _resetSyncBit(-1), + countEnable(true) { core->AddToCycleList(this); trace_direct(&(core->coreTraceGroup), "PRESCALER" + tracename, &preScaleValue); @@ -42,9 +42,9 @@ HWPrescaler::HWPrescaler(AvrDevice *core, IOSpecialReg *ioreg, int resetBit): Hardware(core), - countEnable(true), _resetBit(resetBit), - _resetSyncBit(-1) + _resetSyncBit(-1), + countEnable(true) { core->AddToCycleList(this); trace_direct(&(core->coreTraceGroup), "PRESCALER" + tracename, &preScaleValue); @@ -58,9 +58,9 @@ HWPrescaler::HWPrescaler(AvrDevice *core, int resetBit, int resetSyncBit): Hardware(core), - countEnable(true), _resetBit(resetBit), - _resetSyncBit(resetSyncBit) + _resetSyncBit(resetSyncBit), + countEnable(true) { core->AddToCycleList(this); trace_direct(&(core->coreTraceGroup), "PRESCALER" + tracename, &preScaleValue); diff --git a/src/ioregs.cpp b/src/ioregs.cpp index 04157ee..ea9389d 100644 --- a/src/ioregs.cpp +++ b/src/ioregs.cpp @@ -30,9 +30,9 @@ AddressExtensionRegister::AddressExtensionRegister(AvrDevice *core, unsigned bitsize): Hardware(core), TraceValueRegister(core, regname), + reg_mask((1 << bitsize) - 1), ext_reg(this, regname, - this, &AddressExtensionRegister::GetRegVal, &AddressExtensionRegister::SetRegVal), - reg_mask((1 << bitsize) - 1) { + this, &AddressExtensionRegister::GetRegVal, &AddressExtensionRegister::SetRegVal) { Reset(); } diff --git a/src/irqsystem.cpp b/src/irqsystem.cpp index 3674f61..9bfdb3c 100644 --- a/src/irqsystem.cpp +++ b/src/irqsystem.cpp @@ -187,10 +187,10 @@ HWIrqSystem::HWIrqSystem(AvrDevice* _core, int bytes, int tblsize): TraceValueRegister(_core, "IRQ"), bytesPerVector(bytes), vectorTableSize(tblsize), - debugInterruptTable(tblsize, (Hardware*)NULL), - core(_core), irqTrace(tblsize), - irqStatistic(_core) + core(_core), + irqStatistic(_core), + debugInterruptTable(tblsize, (Hardware*)NULL) { for(int i = 0; i < vectorTableSize; i++) { TraceValue* tv = new TraceValue(1, GetTraceValuePrefix() + "VECTOR" + int2str(i)); diff --git a/src/rwmem.cpp b/src/rwmem.cpp index 3628536..d9720b4 100644 --- a/src/rwmem.cpp +++ b/src/rwmem.cpp @@ -56,8 +56,8 @@ RWMemoryMember::RWMemoryMember(TraceValueRegister *_reg, } RWMemoryMember::RWMemoryMember(void): - registry(NULL), - tv(NULL) {} + tv(NULL), + registry(NULL) {} RWMemoryMember::operator unsigned char() const { if (tv) @@ -89,9 +89,9 @@ RWMemoryMember::~RWMemoryMember() { CLKPRRegister::CLKPRRegister(AvrDevice *core, TraceValueRegister *registry): + RWMemoryMember(registry, "CLKPR"), Hardware(core), - _core(core), - RWMemoryMember(registry, "CLKPR") { + _core(core) { if(_core->fuses->GetFuseBit(AvrFuses::FB_CKDIV8)) value = 3; else @@ -138,8 +138,8 @@ void CLKPRRegister::set(unsigned char v) { XDIVRegister::XDIVRegister(AvrDevice *core, TraceValueRegister *registry): - Hardware(core), - RWMemoryMember(registry, "XDIV") { + RWMemoryMember(registry, "XDIV"), + Hardware(core) { Reset(); } @@ -163,8 +163,8 @@ void XDIVRegister::set(unsigned char v) { OSCCALRegister::OSCCALRegister(AvrDevice *core, TraceValueRegister *registry, int cal): - Hardware(core), RWMemoryMember(registry, "OSCCAL"), + Hardware(core), cal_type(cal){ Reset(); } diff --git a/src/rwmem.h b/src/rwmem.h index 323d235..2f231e2 100644 --- a/src/rwmem.h +++ b/src/rwmem.h @@ -91,8 +91,8 @@ class GPIORegister: public RWMemoryMember, public Hardware { GPIORegister(AvrDevice *core, TraceValueRegister *registry, const std::string &tracename): - Hardware(core), - RWMemoryMember(registry, tracename) { value = 0; } + RWMemoryMember(registry, tracename), + Hardware(core) { value = 0; } // from Hardware void Reset(void) { value = 0; } diff --git a/src/traceval.cpp b/src/traceval.cpp index 41f1a04..41e2559 100644 --- a/src/traceval.cpp +++ b/src/traceval.cpp @@ -38,9 +38,9 @@ TraceValue::TraceValue(size_t bits, const std::string &__name, const int __index, const void *_shadow) : - b(bits), _name(__name), _index(__index), + b(bits), shadow(_shadow), v(0xaffeaffe), f(0), @@ -399,21 +399,21 @@ DumpVCD::DumpVCD(ostream *_os, const std::string &_tscale, const bool rstrobes, const bool wstrobes) : - os(_os), tscale(_tscale), rs(rstrobes), ws(wstrobes), - changesWritten(false) {} + changesWritten(false), + os(_os) {} DumpVCD::DumpVCD(const std::string &_name, const std::string &_tscale, const bool rstrobes, const bool wstrobes) : - os(new ofstream(_name.c_str())), tscale(_tscale), rs(rstrobes), ws(wstrobes), - changesWritten(false) {} + changesWritten(false), + os(new ofstream(_name.c_str())) {} void DumpVCD::setActiveSignals(const TraceSet &act) { tv=act; -- 1.8.4 _______________________________________________ Simulavr-devel mailing list Simulavr-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/simulavr-devel