From: Benjamin Nash Date: Fri, 1 Jul 2005 17:06:35 +0000 (-0400) Subject: Fix formatting, move default size (0x8) of TsunamiFake from C++ code to Python code. X-Git-Tag: m5_1.1~58 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=81b57af24118ad61329a848b3b66874e6e05ecb9;p=gem5.git Fix formatting, move default size (0x8) of TsunamiFake from C++ code to Python code. dev/ide_disk.cc: Fix formatting. Panic if unexpected register type is given. python/m5/objects/Tsunami.py: Add default size of TsunamiFake device. --HG-- extra : convert_revision : 03a35a2f6468b95746cba41ce7e93afeeb70ccef --- diff --git a/dev/ide_disk.cc b/dev/ide_disk.cc index 7096c6948..3d7bd19c0 100644 --- a/dev/ide_disk.cc +++ b/dev/ide_disk.cc @@ -220,34 +220,34 @@ IdeDisk::read(const Addr &offset, RegType_t type) else if (offset == DATA_OFFSET) action = ACT_DATA_READ_SHORT; - switch (offset) { - case DATA_OFFSET: - data = cmdReg.data; - break; - case ERROR_OFFSET: - data = cmdReg.error; - break; - case NSECTOR_OFFSET: - data = cmdReg.sec_count; - break; - case SECTOR_OFFSET: - data = cmdReg.sec_num; - break; - case LCYL_OFFSET: - data = cmdReg.cyl_low; - break; - case HCYL_OFFSET: - data = cmdReg.cyl_high; - break; - case SELECT_OFFSET: - data = cmdReg.drive; - break; - case STATUS_OFFSET: - data = status; - break; - default: - panic("Invalid IDE command register offset: %#x\n", offset); - } + switch (offset) { + case DATA_OFFSET: + data = cmdReg.data; + break; + case ERROR_OFFSET: + data = cmdReg.error; + break; + case NSECTOR_OFFSET: + data = cmdReg.sec_count; + break; + case SECTOR_OFFSET: + data = cmdReg.sec_num; + break; + case LCYL_OFFSET: + data = cmdReg.cyl_low; + break; + case HCYL_OFFSET: + data = cmdReg.cyl_high; + break; + case SELECT_OFFSET: + data = cmdReg.drive; + break; + case STATUS_OFFSET: + data = status; + break; + default: + panic("Invalid IDE command register offset: %#x\n", offset); + } } else if (type == CONTROL_BLOCK) { if (offset != ALTSTAT_OFFSET) @@ -255,6 +255,9 @@ IdeDisk::read(const Addr &offset, RegType_t type) data = status; } + else { + panic("Invalid IDE register type: %#x\n", type); + } if (action != ACT_NONE) updateState(action); diff --git a/python/m5/objects/Tsunami.py b/python/m5/objects/Tsunami.py index 8e16d5d1e..dd52bd11d 100644 --- a/python/m5/objects/Tsunami.py +++ b/python/m5/objects/Tsunami.py @@ -13,7 +13,7 @@ class TsunamiCChip(FooPioDevice): class TsunamiFake(FooPioDevice): type = 'TsunamiFake' - size = Param.Addr("Size of address range") + size = Param.Addr(0x8, "Size of address range") class TsunamiIO(FooPioDevice): type = 'TsunamiIO'