OpenCores
URL https://opencores.org/ocsvn/zet86/zet86/trunk

Subversion Repositories zet86

[/] [zet86/] [tags/] [INITIAL/] [rtl-model/] [cpu.v] - Blame information for rev 49

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 zeus
`timescale 1ns/10ps
2
 
3
`include "defines.v"
4
 
5
module cpu(
6
    input clk,
7
    input rst,
8
    input  [15:0] rd_data,
9
    output [15:0] wr_data,
10
    output [19:0] addr,
11
    output we,
12
    output m_io,
13
    output wr_cnd, // Stub
14
    output byte_m,
15
    output mem_op,
16
    input  mem_rdy
17
  );
18
 
19
  // Net declarations
20
  wire [15:0] cs, ip;
21
  wire [`IR_SIZE-1:0] ir;
22
  wire [15:0] off, imm;
23
  wire [19:0] addr_exec, addr_fetch;
24
  wire byte_fetch, byte_exec, fetch_or_exec;
25
  wire of, zf, cx_zero;
26
 
27
  // Module instantiations
28
  fetch   fetch0(clk, rst, cs, ip, of, zf, cx_zero, rd_data, ir, off,
29
                 imm, addr_fetch, byte_fetch, fetch_or_exec, mem_rdy);
30
  exec    exec0(ir, off, imm, cs, ip, of, zf, cx_zero, clk, rst,
31
                rd_data, wr_data, addr_exec, we, m_io, wr_cnd, byte_exec, mem_rdy);
32
 
33
  // Assignments 
34
  assign addr   = fetch_or_exec ? addr_exec : addr_fetch;
35
  assign byte_m = fetch_or_exec ? byte_exec : byte_fetch;
36
  assign mem_op = rst ? 1'b1 : ir[`MEM_OP];
37
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.