/* Author : Rick van der Zwet * S-number : 0433373 * Version : $Id: memory.h 363 2007-12-03 06:07:31Z rick $ * Copyright : FreeBSD Licence * Description : Memory unit header */ #ifndef MEMORY_H #define MEMORY_H #include "sim.h" /* Signal */ boolean mem_busy; union memword_t { byte byte[4]; halfword halfword[2]; word fullword; }; /* Control signal */ typedef enum { MEM_STALLED, READ, WRITE_BYTE, WRITE_HALFWORD, WRITE_WORD } mem_control_t; void readmem(); void writemem(); word mem_operation(const word address, const word value, const mem_control_t action); #endif