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

Subversion Repositories pepelatz_misc

[/] [pepelatz_misc/] [trunk/] [pepelatz_core/] [pepelatz_main.v] - Blame information for rev 13

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 418ImATeap
//Pepelatz_main.v
2
//This file is the main module of Pepelatz MISC processor. All other modules of Pepelatz must have their own files.
3
//Please, comment all in detail.
4
 
5
 
6
//Module Pepelatz contains the processor root.
7
module Pepelatz
8
  (
9
  //ROM
10
    output[15:0]rom_address,//Address for ROM bus.
11
    input [15:0]rom_data,   //Data from ROM.
12
    input       rom_ready,  //Shows, that rom_data has actual value.
13
 
14
  //RAM
15
    output      ram_write,  //Turn on writing mode.
16
    output[15:0]ram_adress, //Address for RAM bus.
17
    output[15:0]ram_input,  //RAM's write port.
18
    input [15:0]ram_data,   //Data from RAM.
19
    input       ram_ready,  //Shows, that ram_data has actual value.
20
 
21
  //Operations
22
    input clk,              //Clock signal.
23
    input rst               //Reset signal.
24
  );
25
 
26
  //Output regs used by Verilog. (Just remember: you must create a register for each output)
27
   reg[15:0]rom_address;
28
   reg      ram_write;
29
   reg[15:0]ram_adress;
30
   reg[15:0]ram_input;
31
 
32
  //Processor regs
33
 
34
   //Arithmetic stack
35
    reg[5:0] StackPointer;
36
    reg[15:0]Stack[0:63];
37
   //Call stack
38
    reg[3:0]CallPointer;
39
    reg[15:0]CallStack[0:15];
40
   //Pointer to current command.
41
    reg[15:0]PC;
42
 
43
  //Dark regs
44
   reg[15:0] command;//command for decoding
45
   wire GetOperand;//if GetOperand==0 then get next command and place it into stack.
46
     assign GetOperand=command[0];
47
   //Set of wires to instructions
48
    wire [4:0]instruction0;
49
     assign instruction0=command[5:1];
50
    wire [4:0]instruction1;
51
     assign instruction1=command[11:6];
52
    wire [4:0]instruction2;
53
     assign instruction2=command[15:12];
54 13 418ImATeap
    reg GetCommand;//if GetCommand=0, current command is not actual!
55 12 418ImATeap
 
56
  always@(posedge clk)//Main block
57
   if (GetCommand==0) begin//Get command
58
     end else
59
    if (GetOperand==1) begin
60
 
61
    end else begin
62
 
63
    end//always
64
 
65
  always@(posedge rst)//reset
66
    begin
67
     StackPointer=0;
68
     PC=0;
69
     CallPointer=0;
70
     GetCommand=0;
71
    end
72
endmodule//Pepelatz
73
 

powered by: WebSVN 2.1.0

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