File: 0003_subdev.va

package info (click to toggle)
adms 2.3.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,592 kB
  • sloc: xml: 7,167; perl: 4,866; ansic: 3,147; lex: 1,128; yacc: 691; sh: 323; makefile: 110
file content (38 lines) | stat: -rw-r--r-- 617 bytes parent folder | download | duplicates (4)
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
// testing subdevice instanciation
`include "discipline.h"

module net(p, n);
	inout p, n;
	electrical p, n;

// BUG: cannot instanciate subdevices without params.
	parameter real dummy=1 from [0:inf);

	analog begin
		begin
			V(p, n) <+ 0;
		end
	end
endmodule

module RESISTOR(p, n);
	inout p, n;
	electrical p, n;

	parameter real r=1 from [0:inf);
	analog begin
		begin
			I(p, n) <+ V(p, n) / r;
		end
	end
endmodule

module schematic(pp, nn);
	inout pp, nn;
	electrical pp, nn;
	electrical p_int, n_int;

	net #(.dummy(0)) n1(p, p_int);
	net #(.dummy(0)) n2(n, n_int);
	RESISTOR #(.r(1)) r1(pp, nn);
endmodule