Project

General

Profile

Download (1.38 KB) Statistics
| Branch: | Tag: | Revision:
1
open Vhdl_ast
2

    
3
let design1 = {
4
    packages = [{name = "typedef"; shared_defs = [Subtype{name = "byte"; definition = Bit_vector (7, 0)}]}];
5
    libraries = [Use ["work";"typedef";"all"]];
6
    entities = [{ name = "data_path";
7
		  generics = [];
8
		  ports = [
9
		      {name = "clk"; kind = InPort; typ = Base "boolean"};
10
		      {name = "rst"; kind = InPort; typ = Base "boolean"};
11
		      {name = "s_1"; kind = InPort; typ = Base "boolean"};
12
		      {name = "s0"; kind = InPort; typ = Base "bit"};
13
		      {name = "s1"; kind = InPort; typ = Base "bit"};
14
		      {name = "d0"; kind = InPort; typ = Base "byte"};
15
		      {name = "d1"; kind = InPort; typ = Base "byte"};
16
		      {name = "d2"; kind = InPort; typ = Base "byte"};
17
		      {name = "d3"; kind = InPort; typ = Base "byte"};
18
		      {name = "q"; kind = OutPort; typ = Base "byte"};
19
		      
20
		    ];
21
		}];
22
    architectures = [{
23
			name = "behavior";
24
			entity = "data_path";
25
			declarations = [
26
			    SigDecl { name = "reg"; typ = Base "byte"; init_val = None};
27
			    SigDecl { name = "shft"; typ = Base "byte"; init_val = None};
28
			    SigDecl { name = "sel"; typ = Bit_vector(1,0); init_val = None};
29

    
30
			  ];
31
			body = [
32
			    Process {
33
				id = None;
34
				active_sigs = ["clk"; "rst"];
35
				body = [];
36
			      };
37
			    SigAssign {
38
				lhs = "q";
39
				rhs = Var "shft";
40
				cond = None;
41
			      }
42

    
43
			  ];
44
		      }];
45
    configuration = None;
46
  }
47
  
(2-2/2)