1
0

fixes to get groundtest working with priv-1.9 changes

This commit is contained in:
Howard Mao
2016-05-02 18:34:27 -07:00
parent c7c8ae5468
commit 487d0b356e
10 changed files with 24 additions and 53 deletions

View File

@ -10,11 +10,7 @@
void mm_t::write(uint64_t addr, uint8_t *data, uint64_t strb, uint64_t size)
{
strb &= ((1 << size) - 1) << (addr % word_size);
if (addr > this->size) {
fprintf(stderr, "Invalid write address %lx\n", addr);
exit(EXIT_FAILURE);
}
addr %= this->size;
uint8_t *base = this->data + (addr / word_size) * word_size;
for (int i = 0; i < word_size; i++) {
@ -26,10 +22,7 @@ void mm_t::write(uint64_t addr, uint8_t *data, uint64_t strb, uint64_t size)
std::vector<char> mm_t::read(uint64_t addr)
{
if (addr > this->size) {
fprintf(stderr, "Invalid read address %lx\n", addr);
exit(EXIT_FAILURE);
}
addr %= this->size;
uint8_t *base = this->data + addr;
return std::vector<char>(base, base + word_size);