1 |
3 |
barryw |
--Propery of Tecphos Inc. See License.txt for license details
|
2 |
|
|
--Latest version of all project files available at http://opencores.org/project,wrimm
|
3 |
|
|
--See WrimmManual.pdf for the Wishbone Datasheet and implementation details.
|
4 |
|
|
--See wrimm subversion project for version history
|
5 |
|
|
|
6 |
|
|
library ieee;
|
7 |
4 |
barryw |
use ieee.std_logic_1164.all;
|
8 |
3 |
barryw |
|
9 |
|
|
package WrimmPackage is
|
10 |
|
|
|
11 |
4 |
barryw |
constant WbAddrBits : Integer := 4;
|
12 |
|
|
constant WbDataBits : Integer := 8;
|
13 |
|
|
|
14 |
|
|
subtype WbAddrType is std_logic_vector(0 to WbAddrBits-1);
|
15 |
|
|
subtype WbDataType is std_logic_vector(0 to WbDataBits-1);
|
16 |
|
|
|
17 |
|
|
type WbMasterOutType is record
|
18 |
|
|
Strobe : std_logic; --Required
|
19 |
|
|
WrEn : std_logic;
|
20 |
|
|
Addr : WbAddrType;
|
21 |
|
|
Data : WbDataType;
|
22 |
|
|
--DataTag : std_logic_vector(0 to 1); --Write,Set,Clear,Toggle
|
23 |
|
|
Cyc : std_logic; --Required
|
24 |
|
|
--CycType : std_logic_vector(0 to 2); --For Burst Cycles
|
25 |
|
|
end record WbMasterOutType;
|
26 |
|
|
|
27 |
|
|
type WbSlaveOutType is record
|
28 |
|
|
Ack : std_logic; --Required
|
29 |
|
|
Err : std_logic;
|
30 |
|
|
Rty : std_logic;
|
31 |
|
|
Data : WbDataType;
|
32 |
|
|
end record WbSlaveOutType;
|
33 |
|
|
|
34 |
|
|
--=============================================================================
|
35 |
|
|
-------------------------------------------------------------------------------
|
36 |
|
|
-- Master Interfaces
|
37 |
|
|
-------------------------------------------------------------------------------
|
38 |
|
|
type WbMasterType is (
|
39 |
|
|
Q,
|
40 |
|
|
P);
|
41 |
|
|
|
42 |
|
|
type WbMasterOutArray is array (WbMasterType) of WbMasterOutType;
|
43 |
|
|
type WbSlaveOutArray is array (WbMasterType) of WbSlaveOutType;
|
44 |
|
|
|
45 |
|
|
type WbMasterGrantType is Array (WbMasterType'left to WbMasterType'right) of std_logic;
|
46 |
|
|
--=============================================================================
|
47 |
3 |
barryw |
-------------------------------------------------------------------------------
|
48 |
4 |
barryw |
-- Status Registers (Report internal results)
|
49 |
3 |
barryw |
-------------------------------------------------------------------------------
|
50 |
4 |
barryw |
type StatusFieldParams is record
|
51 |
|
|
BitWidth : integer;
|
52 |
|
|
MSBLoc : integer;
|
53 |
|
|
Address : WbAddrType;
|
54 |
3 |
barryw |
end record StatusFieldParams;
|
55 |
|
|
|
56 |
4 |
barryw |
type StatusFieldType is (
|
57 |
|
|
StatusA,
|
58 |
|
|
StatusB,
|
59 |
|
|
StatusC);
|
60 |
3 |
barryw |
|
61 |
4 |
barryw |
type StatusArrayType is Array (StatusFieldType'left to StatusFieldType'right) of WbDataType;
|
62 |
|
|
type StatusArrayBitType is Array (StatusFieldType'left to StatusFieldType'right) of std_logic;
|
63 |
|
|
type StatusFieldDefType is Array (StatusFieldType'left to StatusFieldType'right) of StatusFieldParams;
|
64 |
|
|
|
65 |
|
|
constant StatusParams : StatusFieldDefType :=(
|
66 |
|
|
StatusA => (BitWidth => 8, MSBLoc => 0, Address => x"0"),
|
67 |
|
|
StatusB => (BitWidth => 8, MSBLoc => 0, Address => x"1"),
|
68 |
|
|
StatusC => (BitWidth => 8, MSBLoc => 0, Address => x"2"));
|
69 |
|
|
--=============================================================================
|
70 |
3 |
barryw |
-------------------------------------------------------------------------------
|
71 |
4 |
barryw |
-- Setting Registers
|
72 |
3 |
barryw |
-------------------------------------------------------------------------------
|
73 |
4 |
barryw |
type SettingFieldParams is record
|
74 |
|
|
BitWidth : integer;
|
75 |
|
|
MSBLoc : integer;
|
76 |
|
|
Address : WbAddrType;
|
77 |
|
|
Default : WbDataType;
|
78 |
3 |
barryw |
end record SettingFieldParams;
|
79 |
|
|
|
80 |
4 |
barryw |
type SettingFieldType is (
|
81 |
|
|
SettingX,
|
82 |
|
|
SettingY,
|
83 |
|
|
SettingZ);
|
84 |
3 |
barryw |
|
85 |
4 |
barryw |
type SettingArrayType is Array (SettingFieldType'Left to SettingFieldType'Right) of WbDataType;
|
86 |
|
|
type SettingArrayBitType is Array (SettingFieldType'Left to SettingFieldType'Right) of std_logic;
|
87 |
|
|
type SettingFieldDefType is Array (SettingFieldType'Left to SettingFieldType'Right) of SettingFieldParams;
|
88 |
3 |
barryw |
|
89 |
4 |
barryw |
constant SettingParams : SettingFieldDefType :=(
|
90 |
|
|
SettingX => (BitWidth => 8, MSBLoc => 0, Address => x"6", Default => x"00"),
|
91 |
|
|
SettingY => (BitWidth => 8, MSBLoc => 0, Address => x"7", Default => x"00"),
|
92 |
|
|
SettingZ => (BitWidth => 8, MSBLoc => 0, Address => x"8", Default => x"00"));
|
93 |
|
|
--=============================================================================
|
94 |
3 |
barryw |
-------------------------------------------------------------------------------
|
95 |
4 |
barryw |
-- Trigger Registers (Report internal results)
|
96 |
3 |
barryw |
-------------------------------------------------------------------------------
|
97 |
4 |
barryw |
type TriggerFieldParams is record
|
98 |
|
|
BitLoc : integer;
|
99 |
|
|
Address : WbAddrType;
|
100 |
3 |
barryw |
end record TriggerFieldParams;
|
101 |
|
|
|
102 |
4 |
barryw |
type TriggerFieldType is (
|
103 |
|
|
TriggerR,
|
104 |
|
|
TriggerS,
|
105 |
|
|
TriggerT);
|
106 |
3 |
barryw |
|
107 |
4 |
barryw |
type TriggerArrayType is Array (TriggerFieldType'Left to TriggerFieldType'Right) of std_logic;
|
108 |
|
|
type TriggerFieldDefType is Array (TriggerFieldType'Left to TriggerFieldType'Right) of TriggerFieldParams;
|
109 |
3 |
barryw |
|
110 |
4 |
barryw |
constant TriggerParams : TriggerFieldDefType :=(
|
111 |
|
|
TriggerR => (BitLoc => 7, Address => x"A"),
|
112 |
|
|
TriggerS => (BitLoc => 7, Address => x"B"),
|
113 |
|
|
TriggerT => (BitLoc => 7, Address => x"C"));
|
114 |
3 |
barryw |
|
115 |
|
|
end package WrimmPackage;
|
116 |
4 |
barryw |
|
117 |
3 |
barryw |
--package body WishBonePackage is
|
118 |
|
|
--
|
119 |
|
|
--
|
120 |
|
|
--
|
121 |
|
|
--end package body WishBonePackage;
|