Last change
on this file since 375 was 2, checked in by Rick van der Zwet, 15 years ago |
Initial import of data of old repository ('data') worth keeping (e.g. tracking
means of URL access statistics)
|
-
Property svn:executable
set to
*
|
File size:
1.4 KB
|
Rev | Line | |
---|
[2] | 1 | /* Author : Rick van der Zwet
|
---|
| 2 | * S-number : 0433373
|
---|
| 3 | * Version : $Id: datapath.h 366 2007-12-04 18:29:07Z rick $
|
---|
| 4 | * Copyright : FreeBSD Licence
|
---|
| 5 | * Description : Memory unit header
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #ifndef DATAPATH_H
|
---|
| 9 | #define DATAPATH_H
|
---|
| 10 |
|
---|
| 11 | #include "sim.h"
|
---|
| 12 | #include "alu.h"
|
---|
| 13 | #include "constant.h"
|
---|
| 14 | #include "imm.h"
|
---|
| 15 | #include "memory.h"
|
---|
| 16 |
|
---|
| 17 |
|
---|
| 18 | typedef enum { NO_COMPONENT, A, B, TEMP, TEMP2, PC, MAR, MDR, CONST,
|
---|
| 19 | IMM } sx_control_t;
|
---|
| 20 | typedef enum { DATAPATH, MEMORY } mux_control_t;
|
---|
| 21 | typedef enum { READONLY, WRITE } buffer_control_t;
|
---|
| 22 | typedef enum { R_A=1, R_B, R_AB, W_C, R_AxW_C, R_BxW_C,
|
---|
| 23 | R_ABxW_C } register_control_t;
|
---|
| 24 |
|
---|
| 25 | /* XXX: Not that effient, might be the use of bitfields */
|
---|
| 26 | typedef struct {
|
---|
| 27 | sx_control_t s1;
|
---|
| 28 | sx_control_t s2;
|
---|
| 29 | mux_control_t mux;
|
---|
| 30 | const_control_t constant;
|
---|
| 31 | imm_control_t imm;
|
---|
| 32 | alu_control_t alu_unit;
|
---|
| 33 | mem_control_t memory;
|
---|
| 34 | buffer_control_t a;
|
---|
| 35 | buffer_control_t b;
|
---|
| 36 | buffer_control_t c;
|
---|
| 37 | buffer_control_t temp;
|
---|
| 38 | buffer_control_t temp2;
|
---|
| 39 | buffer_control_t pc;
|
---|
| 40 | buffer_control_t mar;
|
---|
| 41 | buffer_control_t mdr;
|
---|
| 42 | buffer_control_t ir;
|
---|
| 43 | register_control_t reg;
|
---|
| 44 | address_t register_address_a;
|
---|
| 45 | address_t register_address_b;
|
---|
| 46 | address_t register_address_c;
|
---|
| 47 | } control_t;
|
---|
| 48 |
|
---|
| 49 | word a;
|
---|
| 50 | word b;
|
---|
| 51 | word c;
|
---|
| 52 | word temp;
|
---|
| 53 | word temp2;
|
---|
| 54 | word pc;
|
---|
| 55 | word mar;
|
---|
| 56 | word mdr;
|
---|
| 57 | word ir;
|
---|
| 58 | word imm;
|
---|
| 59 | word constant;
|
---|
| 60 |
|
---|
| 61 | word reg[32];
|
---|
| 62 | word select_sx(const sx_control_t control);
|
---|
| 63 | void update_state(control_t control);
|
---|
| 64 |
|
---|
| 65 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.