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 |
|
|
use ieee.std_logic_1164.all;
|
8 |
|
|
|
9 |
|
|
package WrimmPackage is
|
10 |
|
|
|
11 |
|
|
constant WbAddrBits : Integer := 4;
|
12 |
|
|
constant WbDataBits : Integer := 16;
|
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 |
|
|
type WbMasterOutArray is array (natural range <>) of WbMasterOutType;
|
35 |
|
|
type WbSlaveOutArray is array (natural range <>) of WbSlaveOutType;
|
36 |
|
|
|
37 |
|
|
-------------------------------------------------------------------------------
|
38 |
|
|
--
|
39 |
|
|
-- Status Registers (Report internal results)
|
40 |
|
|
--
|
41 |
|
|
-------------------------------------------------------------------------------
|
42 |
|
|
type StatusFieldParams is record
|
43 |
|
|
BitWidth : integer;
|
44 |
|
|
MSBLoc : integer;
|
45 |
|
|
Address : WbAddrType;
|
46 |
|
|
end record StatusFieldParams;
|
47 |
|
|
|
48 |
|
|
type StatusFieldType is (
|
49 |
|
|
StatusA,
|
50 |
|
|
StatusB,
|
51 |
|
|
StatusC);
|
52 |
|
|
|
53 |
|
|
type StatusArrayType is Array (StatusFieldType'Left to StatusFieldType'Right) of WbDataType;
|
54 |
|
|
type StatusArrayBitType is Array (StatusFieldType'Left to StatusFieldType'Right) of std_logic;
|
55 |
|
|
type StatusFieldDefType is Array (StatusFieldType'Left to StatusFieldType'Right) of StatusFieldParams;
|
56 |
|
|
|
57 |
|
|
constant StatusParams : StatusFieldDefType :=(
|
58 |
|
|
StatusA => (BitWidth => 16, MSBLoc => 0, Address => x"0"),
|
59 |
|
|
StatusB => (BitWidth => 8, MSBLoc => 0, Address => x"1"),
|
60 |
|
|
StatusC => (BitWidth => 4, MSBLoc => 12, Address => x"2"));
|
61 |
|
|
-------------------------------------------------------------------------------
|
62 |
|
|
--
|
63 |
|
|
-- Setting Registers
|
64 |
|
|
--
|
65 |
|
|
-------------------------------------------------------------------------------
|
66 |
|
|
type SettingFieldParams is record
|
67 |
|
|
BitWidth : integer;
|
68 |
|
|
MSBLoc : integer;
|
69 |
|
|
Address : WbAddrType;
|
70 |
|
|
Default : WbDataType;
|
71 |
|
|
end record SettingFieldParams;
|
72 |
|
|
|
73 |
|
|
type SettingFieldType is (
|
74 |
|
|
SettingX,
|
75 |
|
|
SettingY,
|
76 |
|
|
SettingZ);
|
77 |
|
|
|
78 |
|
|
type SettingArrayType is Array (SettingFieldType'Left to SettingFieldType'Right) of WbDataType;
|
79 |
|
|
type SettingArrayBitType is Array (SettingFieldType'Left to SettingFieldType'Right) of std_logic;
|
80 |
|
|
type SettingFieldDefType is Array (SettingFieldType'Left to SettingFieldType'Right) of SettingFieldParams;
|
81 |
|
|
|
82 |
|
|
constant SettingParams : SettingFieldDefType :=(
|
83 |
|
|
SettingX => (BitWidth => 32, MSBLoc => 0, Address => x"62", Default => x"0000"),
|
84 |
|
|
SettingY => (BitWidth => 32, MSBLoc => 0, Address => x"64", Default => x"0000"),
|
85 |
|
|
SettingZ => (BitWidth => 1, MSBLoc => 31, Address => x"67", Default => x"0000"));
|
86 |
|
|
|
87 |
|
|
-------------------------------------------------------------------------------
|
88 |
|
|
--
|
89 |
|
|
-- Trigger Registers (Report internal results)
|
90 |
|
|
--
|
91 |
|
|
-------------------------------------------------------------------------------
|
92 |
|
|
type TriggerFieldParams is record
|
93 |
|
|
BitLoc : integer;
|
94 |
|
|
Address : WbAddrType;
|
95 |
|
|
end record TriggerFieldParams;
|
96 |
|
|
|
97 |
|
|
type TriggerFieldType is (
|
98 |
|
|
TriggerR,
|
99 |
|
|
TriggerS,
|
100 |
|
|
TriggerT);
|
101 |
|
|
|
102 |
|
|
type TriggerArrayType is Array (TriggerFieldType'Left to TriggerFieldType'Right) of std_logic;
|
103 |
|
|
type TriggerFieldDefType is Array (TriggerFieldType'Left to TriggerFieldType'Right) of TriggerFieldParams;
|
104 |
|
|
|
105 |
|
|
constant TriggerParams : TriggerFieldDefType :=(
|
106 |
|
|
TriggerR => (BitLoc => 31, Address => x"6"),
|
107 |
|
|
TriggerS => (BitLoc => 31, Address => x"8"),
|
108 |
|
|
TriggerT => (BitLoc => 31, Address => x"8"));
|
109 |
|
|
|
110 |
|
|
end package WrimmPackage;
|
111 |
|
|
|
112 |
|
|
--package body WishBonePackage is
|
113 |
|
|
--
|
114 |
|
|
--
|
115 |
|
|
--
|
116 |
|
|
--end package body WishBonePackage;
|