1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
|
-- Copyright (C) 2002 Morgan Kaufmann Publishers, Inc
-- This file is part of VESTs (Vhdl tESTs).
-- VESTs is free software; you can redistribute it and/or modify it
-- under the terms of the GNU General Public License as published by the
-- Free Software Foundation; either version 2 of the License, or (at
-- your option) any later version.
-- VESTs is distributed in the hope that it will be useful, but WITHOUT
-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-- for more details.
-- You should have received a copy of the GNU General Public License
-- along with VESTs; if not, write to the Free Software Foundation,
-- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
library ieee_proposed; use ieee_proposed.electrical_systems.all;
entity inline_10a is
end entity inline_10a;
architecture test of inline_10a is
constant R : real := 10_000.0;
constant R1 : real := 10_000.0;
constant R2 : real := 10_000.0;
-- code from book
nature electrical_bus is
record
strobe: electrical;
databus : electrical_vector(0 to 7);
end record;
-- end code from book
begin
block_1 : block is
-- code from book
terminal bus_end1, bus_end2 : electrical_bus;
quantity bus_v across bus_i through bus_end1 to bus_end2;
-- end code from book
begin
-- code from book
bus_v == bus_i * R;
-- end code from book
end block block_1;
block_2 : block is
terminal bus_end1, bus_end2 : electrical_bus;
quantity bus_v across bus_i through bus_end1 to bus_end2;
begin
-- code from book
bus_v.strobe == bus_i.strobe * R;
bus_v.databus(0) == bus_i.databus(0) * R;
bus_v.databus(1) == bus_i.databus(1) * R;
-- ...
-- not in book
bus_v.databus(2) == bus_i.databus(2) * R;
bus_v.databus(3) == bus_i.databus(3) * R;
bus_v.databus(4) == bus_i.databus(4) * R;
bus_v.databus(5) == bus_i.databus(5) * R;
bus_v.databus(6) == bus_i.databus(6) * R;
-- end not in book
bus_v.databus(7) == bus_i.databus(7) * R;
-- end code from book
end block block_2;
block_3 : block is
terminal p, m : electrical;
quantity v across i through p to m;
begin
-- code from book
v == i * R;
-- end code from book
end block block_3;
block_4 : block is
terminal p, m : electrical;
quantity v across i through p to m;
begin
-- code from book
v / R == i;
-- end code from book
end block block_4;
block_5 : block is
terminal bus_end1, bus_end2 : electrical_bus;
quantity bus_v across bus_i through bus_end1 to bus_end2;
begin
-- code from book
bus_v.strobe == bus_i.strobe * R;
bus_v.databus(0) == bus_i.databus(0) * R;
-- end code from book
bus_v.databus(1) == bus_i.databus(1) * R;
bus_v.databus(2) == bus_i.databus(2) * R;
bus_v.databus(3) == bus_i.databus(3) * R;
bus_v.databus(4) == bus_i.databus(4) * R;
bus_v.databus(5) == bus_i.databus(5) * R;
bus_v.databus(6) == bus_i.databus(6) * R;
bus_v.databus(7) == bus_i.databus(7) * R;
end block block_5;
block_6 : block is
terminal p1, m1, p2, m2 : electrical;
quantity v1 across i1 through p1 to m1;
quantity v2 across i2 through p2 to m2;
begin
-- code from book
i1 * R1 == i2 * R2; -- illegal
-- end code from book
end block block_6;
block_7 : block is
terminal p1, m1, p2, m2 : electrical;
quantity v1 across i1 through p1 to m1;
quantity v2 across i2 through p2 to m2;
begin
-- code from book
i1 * R1 == i2 * R2 tolerance "current_tolerance";
-- end code from book
end block block_7;
block_8 : block is
terminal p1, m1, p2, m2 : electrical;
quantity v1 across i1 through p1 to m1;
quantity v2 across i2 through p2 to m2;
begin
-- code from book
i1 * R1 == i2 * R2 tolerance i2'tolerance;
-- end code from book
end block block_8;
block_9 : block is
terminal p, m : electrical;
quantity v across i through p to m;
begin
-- code from book
v == i * R tolerance i'tolerance;
-- end code from book
end block block_9;
begin
end architecture test;
|