source: liacs/ca/opdr2b/src/datapath.h@ 4

Last change on this file since 4 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
Line 
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
18typedef enum { NO_COMPONENT, A, B, TEMP, TEMP2, PC, MAR, MDR, CONST,
19 IMM } sx_control_t;
20typedef enum { DATAPATH, MEMORY } mux_control_t;
21typedef enum { READONLY, WRITE } buffer_control_t;
22typedef 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 */
26typedef 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
49word a;
50word b;
51word c;
52word temp;
53word temp2;
54word pc;
55word mar;
56word mdr;
57word ir;
58word imm;
59word constant;
60
61word reg[32];
62word select_sx(const sx_control_t control);
63void update_state(control_t control);
64
65#endif
Note: See TracBrowser for help on using the repository browser.