diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cpu/testers/rubytest/Check.cc | 6 | ||||
-rw-r--r-- | src/cpu/testers/rubytest/Check.hh | 2 | ||||
-rw-r--r-- | src/mem/ruby/common/DataBlock.cc | 8 | ||||
-rw-r--r-- | src/mem/ruby/common/DataBlock.hh | 22 | ||||
-rw-r--r-- | src/mem/ruby/common/SubBlock.hh | 8 | ||||
-rw-r--r-- | src/mem/ruby/common/TypeDefines.hh | 2 | ||||
-rw-r--r-- | src/mem/ruby/system/DMASequencer.hh | 2 | ||||
-rw-r--r-- | src/mem/ruby/system/MemoryVector.hh | 40 | ||||
-rw-r--r-- | src/mem/ruby/system/RubyPort.cc | 4 | ||||
-rw-r--r-- | src/mem/ruby/system/System.cc | 8 | ||||
-rw-r--r-- | src/mem/ruby/system/System.hh | 4 |
11 files changed, 52 insertions, 54 deletions
diff --git a/src/cpu/testers/rubytest/Check.cc b/src/cpu/testers/rubytest/Check.cc index 213b8e8d2..7de3415b1 100644 --- a/src/cpu/testers/rubytest/Check.cc +++ b/src/cpu/testers/rubytest/Check.cc @@ -189,7 +189,7 @@ Check::initiateAction() // } PacketPtr pkt = new Packet(req, cmd); - uint8_t* writeData = new uint8_t; + uint8_t *writeData = new uint8_t; *writeData = m_value + m_store_count; pkt->dataDynamic(writeData); @@ -245,7 +245,7 @@ Check::initiateCheck() req->setThreadContext(index, 0); PacketPtr pkt = new Packet(req, MemCmd::ReadReq); - uint8_t* dataArray = new uint8_t[CHECK_SIZE]; + uint8_t *dataArray = new uint8_t[CHECK_SIZE]; pkt->dataDynamicArray(dataArray); // push the subblock onto the sender state. The sequencer will @@ -306,7 +306,7 @@ Check::performCallback(NodeID proc, SubBlock* data) DPRINTF(RubyTest, "Check callback\n"); // Perform load/check for (int byte_number=0; byte_number<CHECK_SIZE; byte_number++) { - if (uint8(m_value + byte_number) != data->getByte(byte_number)) { + if (uint8_t(m_value + byte_number) != data->getByte(byte_number)) { panic("Action/check failure: proc: %d address: %s data: %s " "byte_number: %d m_value+byte_number: %d byte: %d %s" "Time: %d\n", diff --git a/src/cpu/testers/rubytest/Check.hh b/src/cpu/testers/rubytest/Check.hh index 1d84b446b..6396189cc 100644 --- a/src/cpu/testers/rubytest/Check.hh +++ b/src/cpu/testers/rubytest/Check.hh @@ -68,7 +68,7 @@ class Check void debugPrint(); TesterStatus m_status; - uint8 m_value; + uint8_t m_value; int m_store_count; NodeID m_initiatingNode; Address m_address; diff --git a/src/mem/ruby/common/DataBlock.cc b/src/mem/ruby/common/DataBlock.cc index 59a0f692a..c71449dd0 100644 --- a/src/mem/ruby/common/DataBlock.cc +++ b/src/mem/ruby/common/DataBlock.cc @@ -31,7 +31,7 @@ DataBlock::DataBlock(const DataBlock &cp) { - m_data = new uint8[RubySystem::getBlockSizeBytes()]; + m_data = new uint8_t[RubySystem::getBlockSizeBytes()]; memcpy(m_data, cp.m_data, RubySystem::getBlockSizeBytes()); m_alloc = true; } @@ -39,7 +39,7 @@ DataBlock::DataBlock(const DataBlock &cp) void DataBlock::alloc() { - m_data = new uint8[RubySystem::getBlockSizeBytes()]; + m_data = new uint8_t[RubySystem::getBlockSizeBytes()]; m_alloc = true; clear(); } @@ -70,7 +70,7 @@ DataBlock::print(std::ostream& out) const out << dec << "]" << flush; } -const uint8* +const uint8_t* DataBlock::getData(int offset, int len) const { assert(offset + len <= RubySystem::getBlockSizeBytes()); @@ -78,7 +78,7 @@ DataBlock::getData(int offset, int len) const } void -DataBlock::setData(uint8* data, int offset, int len) +DataBlock::setData(uint8_t *data, int offset, int len) { assert(offset + len <= RubySystem::getBlockSizeBytes()); memcpy(&m_data[offset], data, len); diff --git a/src/mem/ruby/common/DataBlock.hh b/src/mem/ruby/common/DataBlock.hh index 0ab4cfc01..56320523b 100644 --- a/src/mem/ruby/common/DataBlock.hh +++ b/src/mem/ruby/common/DataBlock.hh @@ -29,12 +29,12 @@ #ifndef __MEM_RUBY_COMMON_DATABLOCK_HH__ #define __MEM_RUBY_COMMON_DATABLOCK_HH__ +#include <inttypes.h> + #include <cassert> #include <iomanip> #include <iostream> -#include "mem/ruby/common/TypeDefines.hh" - class DataBlock { public: @@ -53,25 +53,25 @@ class DataBlock DataBlock& operator=(const DataBlock& obj); - void assign(uint8* data); + void assign(uint8_t *data); void clear(); - uint8 getByte(int whichByte) const; - const uint8* getData(int offset, int len) const; - void setByte(int whichByte, uint8 data); - void setData(uint8* data, int offset, int len); + uint8_t getByte(int whichByte) const; + const uint8_t *getData(int offset, int len) const; + void setByte(int whichByte, uint8_t data); + void setData(uint8_t *data, int offset, int len); void copyPartial(const DataBlock & dblk, int offset, int len); bool equal(const DataBlock& obj) const; void print(std::ostream& out) const; private: void alloc(); - uint8* m_data; + uint8_t *m_data; bool m_alloc; }; inline void -DataBlock::assign(uint8* data) +DataBlock::assign(uint8_t *data) { assert(data != NULL); if (m_alloc) { @@ -81,14 +81,14 @@ DataBlock::assign(uint8* data) m_alloc = false; } -inline uint8 +inline uint8_t DataBlock::getByte(int whichByte) const { return m_data[whichByte]; } inline void -DataBlock::setByte(int whichByte, uint8 data) +DataBlock::setByte(int whichByte, uint8_t data) { m_data[whichByte] = data; } diff --git a/src/mem/ruby/common/SubBlock.hh b/src/mem/ruby/common/SubBlock.hh index 3ebc99630..6edb82ecc 100644 --- a/src/mem/ruby/common/SubBlock.hh +++ b/src/mem/ruby/common/SubBlock.hh @@ -48,12 +48,12 @@ class SubBlock int getSize() const { return m_data.size(); } void resize(int size) { m_data.resize(size); } - uint8 getByte(int offset) const { return m_data[offset]; } - void setByte(int offset, uint8 data) { m_data[offset] = data; } + uint8_t getByte(int offset) const { return m_data[offset]; } + void setByte(int offset, uint8_t data) { m_data[offset] = data; } // Shorthands - uint8 readByte() const { return getByte(0); } - void writeByte(uint8 data) { setByte(0, data); } + uint8_t readByte() const { return getByte(0); } + void writeByte(uint8_t data) { setByte(0, data); } // Merging to and from DataBlocks - We only need to worry about // updates when we are using DataBlocks diff --git a/src/mem/ruby/common/TypeDefines.hh b/src/mem/ruby/common/TypeDefines.hh index a7b8a6101..3923c6b85 100644 --- a/src/mem/ruby/common/TypeDefines.hh +++ b/src/mem/ruby/common/TypeDefines.hh @@ -30,8 +30,6 @@ #ifndef TYPEDEFINES_H #define TYPEDEFINES_H - -typedef unsigned char uint8; typedef unsigned int uint32; typedef unsigned long long uint64; diff --git a/src/mem/ruby/system/DMASequencer.hh b/src/mem/ruby/system/DMASequencer.hh index ce85c20c7..d8a6ef059 100644 --- a/src/mem/ruby/system/DMASequencer.hh +++ b/src/mem/ruby/system/DMASequencer.hh @@ -43,7 +43,7 @@ struct DMARequest bool write; int bytes_completed; int bytes_issued; - uint8* data; + uint8_t *data; PacketPtr pkt; }; diff --git a/src/mem/ruby/system/MemoryVector.hh b/src/mem/ruby/system/MemoryVector.hh index f8e407942..60707037d 100644 --- a/src/mem/ruby/system/MemoryVector.hh +++ b/src/mem/ruby/system/MemoryVector.hh @@ -48,16 +48,16 @@ class MemoryVector void resize(uint64 size); // destructive - void write(const Address & paddr, uint8* data, int len); - uint8* read(const Address & paddr, uint8* data, int len); - uint32 collatePages(uint8* &raw_data); - void populatePages(uint8* raw_data); + void write(const Address & paddr, uint8_t *data, int len); + uint8_t *read(const Address & paddr, uint8_t *data, int len); + uint32 collatePages(uint8_t *&raw_data); + void populatePages(uint8_t *raw_data); private: - uint8* getBlockPtr(const PhysAddress & addr); + uint8_t *getBlockPtr(const PhysAddress & addr); uint64 m_size; - uint8** m_pages; + uint8_t **m_pages; uint32 m_num_pages; const uint32 m_page_offset_mask; static const uint32 PAGE_SIZE = 4096; @@ -104,12 +104,12 @@ MemoryVector::resize(uint64 size) m_size = size; assert(size%PAGE_SIZE == 0); m_num_pages = size >> 12; - m_pages = new uint8*[m_num_pages]; - memset(m_pages, 0, m_num_pages * sizeof(uint8*)); + m_pages = new uint8_t*[m_num_pages]; + memset(m_pages, 0, m_num_pages * sizeof(uint8_t*)); } inline void -MemoryVector::write(const Address & paddr, uint8* data, int len) +MemoryVector::write(const Address & paddr, uint8_t *data, int len) { assert(paddr.getAddress() + len <= m_size); uint32 page_num = paddr.getAddress() >> 12; @@ -123,7 +123,7 @@ MemoryVector::write(const Address & paddr, uint8* data, int len) } if (all_zeros) return; - m_pages[page_num] = new uint8[PAGE_SIZE]; + m_pages[page_num] = new uint8_t[PAGE_SIZE]; memset(m_pages[page_num], 0, PAGE_SIZE); uint32 offset = paddr.getAddress() & m_page_offset_mask; memcpy(&m_pages[page_num][offset], data, len); @@ -133,8 +133,8 @@ MemoryVector::write(const Address & paddr, uint8* data, int len) } } -inline uint8* -MemoryVector::read(const Address & paddr, uint8* data, int len) +inline uint8_t* +MemoryVector::read(const Address & paddr, uint8_t *data, int len) { assert(paddr.getAddress() + len <= m_size); uint32 page_num = paddr.getAddress() >> 12; @@ -147,12 +147,12 @@ MemoryVector::read(const Address & paddr, uint8* data, int len) return data; } -inline uint8* +inline uint8_t* MemoryVector::getBlockPtr(const PhysAddress & paddr) { uint32 page_num = paddr.getAddress() >> 12; if (m_pages[page_num] == 0) { - m_pages[page_num] = new uint8[PAGE_SIZE]; + m_pages[page_num] = new uint8_t[PAGE_SIZE]; memset(m_pages[page_num], 0, PAGE_SIZE); } return &m_pages[page_num][paddr.getAddress()&m_page_offset_mask]; @@ -167,7 +167,7 @@ MemoryVector::getBlockPtr(const PhysAddress & paddr) */ inline uint32 -MemoryVector::collatePages(uint8* &raw_data) +MemoryVector::collatePages(uint8_t *&raw_data) { uint32 num_zero_pages = 0; uint32 data_size = 0; @@ -177,9 +177,9 @@ MemoryVector::collatePages(uint8* &raw_data) if (m_pages[i] == 0) num_zero_pages++; } - raw_data = new uint8[ sizeof(uint32) /* number of pages*/ - + m_num_pages /* whether the page is all zeros */ - + PAGE_SIZE * (m_num_pages - num_zero_pages)]; + raw_data = new uint8_t[sizeof(uint32) /* number of pages*/ + + m_num_pages /* whether the page is all zeros */ + + PAGE_SIZE * (m_num_pages - num_zero_pages)]; /* Write the number of pages to be stored. */ memcpy(raw_data, &m_num_pages, sizeof(uint32)); @@ -210,7 +210,7 @@ MemoryVector::collatePages(uint8* &raw_data) * in the checkpoint. */ inline void -MemoryVector::populatePages(uint8* raw_data) +MemoryVector::populatePages(uint8_t *raw_data) { uint32 data_size = 0; uint32 num_pages = 0; @@ -226,7 +226,7 @@ MemoryVector::populatePages(uint8* raw_data) { assert(m_pages[i] == 0); if (raw_data[data_size] != 0) { - m_pages[i] = new uint8[PAGE_SIZE]; + m_pages[i] = new uint8_t[PAGE_SIZE]; memcpy(m_pages[i], raw_data + data_size + 1, PAGE_SIZE); data_size += PAGE_SIZE; } diff --git a/src/mem/ruby/system/RubyPort.cc b/src/mem/ruby/system/RubyPort.cc index d14b3dba7..d2d82010d 100644 --- a/src/mem/ruby/system/RubyPort.cc +++ b/src/mem/ruby/system/RubyPort.cc @@ -275,7 +275,7 @@ RubyPort::M5Port::doFunctionalRead(PacketPtr pkt) } assert(num_rw <= 1); - uint8* data = pkt->getPtr<uint8_t>(true); + uint8_t *data = pkt->getPtr<uint8_t>(true); unsigned int size_in_bytes = pkt->getSize(); unsigned startByte = address.getAddress() - line_address.getAddress(); @@ -387,7 +387,7 @@ RubyPort::M5Port::doFunctionalWrite(PacketPtr pkt) num_busy, num_ro, num_rw); assert(num_rw <= 1); - uint8* data = pkt->getPtr<uint8_t>(true); + uint8_t *data = pkt->getPtr<uint8_t>(true); unsigned int size_in_bytes = pkt->getSize(); unsigned startByte = addr.getAddress() - line_addr.getAddress(); diff --git a/src/mem/ruby/system/System.cc b/src/mem/ruby/system/System.cc index c22272e03..8d8db7bbd 100644 --- a/src/mem/ruby/system/System.cc +++ b/src/mem/ruby/system/System.cc @@ -150,7 +150,7 @@ RubySystem::printStats(ostream& out) } void -RubySystem::writeCompressedTrace(uint8* raw_data, string filename, +RubySystem::writeCompressedTrace(uint8_t *raw_data, string filename, uint64 uncompressed_trace_size) { // Create the checkpoint file for the memory @@ -231,7 +231,7 @@ RubySystem::serialize(std::ostream &os) // Restore curTick curTick(curtick_original); - uint8* raw_data = NULL; + uint8_t *raw_data = NULL; if (m_mem_vec_ptr != NULL) { uint64 memory_trace_size = m_mem_vec_ptr->collatePages(raw_data); @@ -264,7 +264,7 @@ RubySystem::serialize(std::ostream &os) } void -RubySystem::readCompressedTrace(string filename, uint8*& raw_data, +RubySystem::readCompressedTrace(string filename, uint8_t *&raw_data, uint64& uncompressed_trace_size) { // Read the trace file @@ -303,7 +303,7 @@ RubySystem::unserialize(Checkpoint *cp, const string §ion) // value of curTick() // clearStats(); - uint8* uncompressed_trace = NULL; + uint8_t *uncompressed_trace = NULL; if (m_mem_vec_ptr != NULL) { string memory_trace_file; diff --git a/src/mem/ruby/system/System.hh b/src/mem/ruby/system/System.hh index 7426894d8..c7d005085 100644 --- a/src/mem/ruby/system/System.hh +++ b/src/mem/ruby/system/System.hh @@ -135,9 +135,9 @@ class RubySystem : public ClockedObject static void printSystemConfig(std::ostream& out); void readCompressedTrace(std::string filename, - uint8*& raw_data, + uint8_t *&raw_data, uint64& uncompressed_trace_size); - void writeCompressedTrace(uint8* raw_data, std::string file, + void writeCompressedTrace(uint8_t *raw_data, std::string file, uint64 uncompressed_trace_size); private: |