1 |
3 |
barryw |
--Propery of Tecphos Inc. See License.txt for license details
|
2 |
9 |
barryw |
--Latest version of all project files available at
|
3 |
|
|
--http://opencores.org/project,wrimm
|
4 |
3 |
barryw |
--See WrimmManual.pdf for the Wishbone Datasheet and implementation details.
|
5 |
|
|
--See wrimm subversion project for version history
|
6 |
|
|
|
7 |
9 |
barryw |
------------------------------------------------------------
|
8 |
|
|
--**********************************************************
|
9 |
|
|
--**********************************************************
|
10 |
|
|
--!!!!!!!!!!!!!!!!!! EDIT THIS FILE !!!!!!!!!!!!!!!!!
|
11 |
|
|
--Save a copy of this file in a project specific directory.
|
12 |
|
|
--Each project may have a different WrimmPackage.vhd file.
|
13 |
|
|
--Hopefully wrimm.vhd will not require modification for each
|
14 |
|
|
--project.
|
15 |
|
|
-->>>>>>>>>>>>>>>>>>>>>>>Start of Customization Example>>>>>>>>>>>>>>>>>>>>>>>>>
|
16 |
|
|
-- Edit or at least verify the data in all the sections of this file
|
17 |
|
|
-- surrounded by the indicator lines shown above and below this text.
|
18 |
|
|
--<<<<<<<<<<<<<<<<<<<<<<<End of Customization Ecample<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
19 |
|
|
-- Hopefully the code ouside those marked sections
|
20 |
|
|
-- will not require modification.
|
21 |
|
|
--**********************************************************
|
22 |
|
|
--**********************************************************
|
23 |
|
|
------------------------------------------------------------
|
24 |
|
|
|
25 |
3 |
barryw |
library ieee;
|
26 |
4 |
barryw |
use ieee.std_logic_1164.all;
|
27 |
3 |
barryw |
|
28 |
|
|
package WrimmPackage is
|
29 |
9 |
barryw |
-->>>>>>>>>>>>>>>>>>>>>>>Start of Wishbone Bus Parameters >>>>>>>>>>>>>>>>>>>>>>
|
30 |
4 |
barryw |
constant WbAddrBits : Integer := 4;
|
31 |
|
|
constant WbDataBits : Integer := 8;
|
32 |
9 |
barryw |
--<<<<<<<<<<<<<<<<<<<<<<<End of Wishbone Bus Parameters <<<<<<<<<<<<<<<<<<<<<<<<
|
33 |
4 |
barryw |
|
34 |
|
|
subtype WbAddrType is std_logic_vector(0 to WbAddrBits-1);
|
35 |
|
|
subtype WbDataType is std_logic_vector(0 to WbDataBits-1);
|
36 |
|
|
|
37 |
|
|
type WbMasterOutType is record
|
38 |
|
|
Strobe : std_logic; --Required
|
39 |
9 |
barryw |
WrEn : std_logic; --Required
|
40 |
|
|
Addr : WbAddrType; --Required
|
41 |
4 |
barryw |
Data : WbDataType;
|
42 |
|
|
--DataTag : std_logic_vector(0 to 1); --Write,Set,Clear,Toggle
|
43 |
|
|
Cyc : std_logic; --Required
|
44 |
|
|
--CycType : std_logic_vector(0 to 2); --For Burst Cycles
|
45 |
|
|
end record WbMasterOutType;
|
46 |
|
|
|
47 |
|
|
type WbSlaveOutType is record
|
48 |
|
|
Ack : std_logic; --Required
|
49 |
|
|
Err : std_logic;
|
50 |
|
|
Rty : std_logic;
|
51 |
|
|
Data : WbDataType;
|
52 |
|
|
end record WbSlaveOutType;
|
53 |
|
|
|
54 |
9 |
barryw |
--==========================================================
|
55 |
|
|
------------------------------------------------------------
|
56 |
|
|
-- Master Interfaces: provides interfaces for 1-n Masters
|
57 |
|
|
------------------------------------------------------------
|
58 |
4 |
barryw |
type WbMasterType is (
|
59 |
9 |
barryw |
-->>>>>>>>>>>>>>>>>>>>>>>Start of Wishbone Master List >>>>>>>>>>>>>>>>>>>>>>>>>
|
60 |
4 |
barryw |
Q,
|
61 |
|
|
P);
|
62 |
9 |
barryw |
--<<<<<<<<<<<<<<<<<<<<<<<End of Wishbone Master List <<<<<<<<<<<<<<<<<<<<<<<<<<<
|
63 |
4 |
barryw |
|
64 |
|
|
type WbMasterOutArray is array (WbMasterType) of WbMasterOutType;
|
65 |
|
|
type WbSlaveOutArray is array (WbMasterType) of WbSlaveOutType;
|
66 |
|
|
|
67 |
|
|
type WbMasterGrantType is Array (WbMasterType'left to WbMasterType'right) of std_logic;
|
68 |
9 |
barryw |
--==========================================================
|
69 |
|
|
------------------------------------------------------------
|
70 |
|
|
-- Status Registers: Report results from other modules
|
71 |
|
|
------------------------------------------------------------
|
72 |
4 |
barryw |
type StatusFieldParams is record
|
73 |
|
|
BitWidth : integer;
|
74 |
|
|
MSBLoc : integer;
|
75 |
|
|
Address : WbAddrType;
|
76 |
3 |
barryw |
end record StatusFieldParams;
|
77 |
|
|
|
78 |
4 |
barryw |
type StatusFieldType is (
|
79 |
9 |
barryw |
-->>>>>>>>>>>>>>>>>>>>>>>Start of Status Field List >>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
80 |
4 |
barryw |
StatusA,
|
81 |
|
|
StatusB,
|
82 |
|
|
StatusC);
|
83 |
9 |
barryw |
--<<<<<<<<<<<<<<<<<<<<<<<End of Status Field List <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
84 |
3 |
barryw |
|
85 |
4 |
barryw |
type StatusArrayType is Array (StatusFieldType'left to StatusFieldType'right) of WbDataType;
|
86 |
|
|
type StatusArrayBitType is Array (StatusFieldType'left to StatusFieldType'right) of std_logic;
|
87 |
|
|
type StatusFieldDefType is Array (StatusFieldType'left to StatusFieldType'right) of StatusFieldParams;
|
88 |
|
|
|
89 |
|
|
constant StatusParams : StatusFieldDefType :=(
|
90 |
9 |
barryw |
-->>>>>>>>>>>>>>>>>>>>>>>Start of Status Field Parameters >>>>>>>>>>>>>>>>>>>>>>
|
91 |
4 |
barryw |
StatusA => (BitWidth => 8, MSBLoc => 0, Address => x"0"),
|
92 |
|
|
StatusB => (BitWidth => 8, MSBLoc => 0, Address => x"1"),
|
93 |
|
|
StatusC => (BitWidth => 8, MSBLoc => 0, Address => x"2"));
|
94 |
9 |
barryw |
--<<<<<<<<<<<<<<<<<<<<<<<End of Status Field Parameters <<<<<<<<<<<<<<<<<<<<<<<<
|
95 |
|
|
--==========================================================
|
96 |
|
|
------------------------------------------------------------
|
97 |
|
|
-- Setting Registers: Provide config bits to other modules
|
98 |
|
|
------------------------------------------------------------
|
99 |
4 |
barryw |
type SettingFieldParams is record
|
100 |
|
|
BitWidth : integer;
|
101 |
|
|
MSBLoc : integer;
|
102 |
|
|
Address : WbAddrType;
|
103 |
|
|
Default : WbDataType;
|
104 |
3 |
barryw |
end record SettingFieldParams;
|
105 |
|
|
|
106 |
4 |
barryw |
type SettingFieldType is (
|
107 |
9 |
barryw |
-->>>>>>>>>>>>>>>>>>>>>>>Start of Setting Field List >>>>>>>>>>>>>>>>>>>>>>>>>>>
|
108 |
4 |
barryw |
SettingX,
|
109 |
|
|
SettingY,
|
110 |
|
|
SettingZ);
|
111 |
9 |
barryw |
--<<<<<<<<<<<<<<<<<<<<<<<End of Setting Field List <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
112 |
3 |
barryw |
|
113 |
4 |
barryw |
type SettingArrayType is Array (SettingFieldType'Left to SettingFieldType'Right) of WbDataType;
|
114 |
|
|
type SettingArrayBitType is Array (SettingFieldType'Left to SettingFieldType'Right) of std_logic;
|
115 |
|
|
type SettingFieldDefType is Array (SettingFieldType'Left to SettingFieldType'Right) of SettingFieldParams;
|
116 |
3 |
barryw |
|
117 |
4 |
barryw |
constant SettingParams : SettingFieldDefType :=(
|
118 |
9 |
barryw |
-->>>>>>>>>>>>>>>>>>>>>>>Start of Setting Field Parameters >>>>>>>>>>>>>>>>>>>>>
|
119 |
8 |
barryw |
SettingX => (BitWidth => 8, MSBLoc => 0, Address => x"6", Default => x"05"),
|
120 |
|
|
SettingY => (BitWidth => 8, MSBLoc => 0, Address => x"7", Default => x"3C"),
|
121 |
|
|
SettingZ => (BitWidth => 8, MSBLoc => 0, Address => x"8", Default => x"AA"));
|
122 |
9 |
barryw |
--<<<<<<<<<<<<<<<<<<<<<<<End of Setting Field Parameters<<<<<<<<<<<<<<<<<<<<<<<<
|
123 |
|
|
--==========================================================
|
124 |
|
|
------------------------------------------------------------
|
125 |
|
|
-- Trigger Registers, Launch other processes, cleared by those processes
|
126 |
|
|
------------------------------------------------------------
|
127 |
4 |
barryw |
type TriggerFieldParams is record
|
128 |
|
|
BitLoc : integer;
|
129 |
|
|
Address : WbAddrType;
|
130 |
3 |
barryw |
end record TriggerFieldParams;
|
131 |
|
|
|
132 |
4 |
barryw |
type TriggerFieldType is (
|
133 |
9 |
barryw |
-->>>>>>>>>>>>>>>>>>>>>>>Start of Trigger List >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
134 |
4 |
barryw |
TriggerR,
|
135 |
|
|
TriggerS,
|
136 |
|
|
TriggerT);
|
137 |
9 |
barryw |
--<<<<<<<<<<<<<<<<<<<<<<<End of Trigger List <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
138 |
3 |
barryw |
|
139 |
4 |
barryw |
type TriggerArrayType is Array (TriggerFieldType'Left to TriggerFieldType'Right) of std_logic;
|
140 |
|
|
type TriggerFieldDefType is Array (TriggerFieldType'Left to TriggerFieldType'Right) of TriggerFieldParams;
|
141 |
3 |
barryw |
|
142 |
4 |
barryw |
constant TriggerParams : TriggerFieldDefType :=(
|
143 |
9 |
barryw |
-->>>>>>>>>>>>>>>>>>>>>>>Start of Trigger Parameters >>>>>>>>>>>>>>>>>>>>>>>>>>>
|
144 |
4 |
barryw |
TriggerR => (BitLoc => 7, Address => x"A"),
|
145 |
|
|
TriggerS => (BitLoc => 7, Address => x"B"),
|
146 |
|
|
TriggerT => (BitLoc => 7, Address => x"C"));
|
147 |
9 |
barryw |
--<<<<<<<<<<<<<<<<<<<<<<<End of Trigger Parameters <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
148 |
3 |
barryw |
|
149 |
|
|
end package WrimmPackage;
|
150 |
4 |
barryw |
|
151 |
3 |
barryw |
--package body WishBonePackage is
|
152 |
|
|
--
|
153 |
9 |
barryw |
-- No package functions (yet)
|
154 |
3 |
barryw |
--
|
155 |
|
|
--end package body WishBonePackage;
|