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

Subversion Repositories versatile_mem_ctrl

[/] [versatile_mem_ctrl/] [trunk/] [bench/] [wbm.v] - Blame information for rev 94

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

Line No. Rev Author Line
1 94 unneback
module wbm (
2
  output [31:0] adr_o,
3
  output [1:0] bte_o,
4
  output [2:0] cti_o,
5
  output [31:0] dat_o,
6
  output [3:0] sel_o,
7
  output we_o,
8
  output cyc_o,
9
  output stb_o,
10
  input wire [31:0] dat_i,
11
  input wire ack_i,
12
  input wire clk,
13
  input wire reset,
14
  output reg OK
15
);
16
 
17
        parameter [1:0] linear = 2'b00,
18
                        beat4  = 2'b01,
19
                        beat8  = 2'b10,
20
                        beat16 = 2'b11;
21
 
22
    parameter [2:0] classic = 3'b000,
23
                    inc     = 3'b010,
24
                    eob         = 3'b111;
25
 
26
        parameter instructions = 32;
27
 
28
        parameter [32+2+3+32+4+1+1+1:1] inst_rom [0:instructions-1]= {
29
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
30
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
31
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
32
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
33
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
34
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
35
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
36
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
37
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
38
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
39
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
40
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
41
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
42
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
43
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
44
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
45
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
46
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
47
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
48
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
49
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
50
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
51
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
52
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
53
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
54
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
55
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
56
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
57
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
58
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
59
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0},
60
                {32'h0,linear,classic,32'h0,4'b1111,1'b0,1'b0,1'b0}};
61
 
62
        parameter [31:0] dat [0:instructions-1] = {
63
                32'h0,
64
                32'h0,
65
                32'h0,
66
                32'h0,
67
                32'h0,
68
                32'h0,
69
                32'h0,
70
                32'h0,
71
                32'h0,
72
                32'h0,
73
                32'h0,
74
                32'h0,
75
                32'h0,
76
                32'h0,
77
                32'h0,
78
                32'h0,
79
                32'h0,
80
                32'h0,
81
                32'h0,
82
                32'h0,
83
                32'h0,
84
                32'h0,
85
                32'h0,
86
                32'h0,
87
                32'h0,
88
                32'h0,
89
                32'h0,
90
                32'h0,
91
                32'h0,
92
                32'h0,
93
                32'h0,
94
                32'h0};
95
 
96
//      parameter idle   = 1'b0;
97
//      parameter active = 1'b1;
98
//      
99
//      reg state;
100
 
101
        integer i;
102
 
103
        assign {adr_o,bte_o,cti_o,dat_o,sel_o,we_o,cyc_o,stb_o} = inst_rom[i];
104
 
105
        always @ (posedge clk or posedge reset)
106
        if (reset)
107
                i = 0;
108
        else
109
                if ((!stb_o | ack_i) & i < instructions)
110
                        i = i + 1;
111
 
112
        always @ (posedge clk or posedge reset)
113
        if (reset)
114
                OK <= 1'b1;
115
        else
116
                if (ack_i & !we_o & (dat_i != dat[i]))
117
                        OK <= 1'b0;
118
                        //assert "Read error";
119
 
120
//      always @ (posedge clk or posedge reset)
121
//      if (reset)
122
//              state <= idle;
123
//      else
124
//              if (state==idle & cyc_o)
125
//                      state <= active;
126
//              else if ((cti_o==3'b000 | cti_o==3'b111) & cyc_o & stb_o & ack_i)
127
//                      state <= idle;
128
 
129
endmodule

powered by: WebSVN 2.1.0

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