-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.td
92 lines (77 loc) · 3.65 KB
/
example.td
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
package example;
use snappy;
use student_schema_parser;
streamlet TydiDemoTop_Interface {
# Compressed data #
input: snappy.byte_stream in;
# Decompressed data #
output: SimilarityVectorStream out;
}
Char = Bit(8);
n = 4.0;
// Avoid collision with Java's String type when compiling Chisel
String_t = Stream(Char, t=n, d=1, c=8);
Group Exam {
course_code: String_t;
course_name: String_t;
exam_date: String_t;
grade: Bit(7);
}
Group Student {
student_number: String_t;
name: String_t;
birthdate: String_t;
study_start: String_t;
study_end: String_t;
study: String_t;
email: String_t;
exams: Stream(Exam, t=1.0, d=1);
}
StudentStream = Stream(Student, t=1.0, d=1);
streamlet StudentFilterInterface {
input_string_parser_L1_00_inst: student_schema_parser.t<3>.JSONStream in;
input_string_parser_L1_01_inst: student_schema_parser.t<3>.JSONStream in;
input_string_parser_L1_02_inst: student_schema_parser.t<3>.JSONStream in;
input_string_parser_L1_03_inst: student_schema_parser.t<3>.JSONStream in;
input_key_parser_L2_04_inst: student_schema_parser.t<3>.JSONStream in;
input_string_parser_L1_04_inst: student_schema_parser.t<3>.JSONStream in;
input_string_parser_L1_05_inst: student_schema_parser.t<3>.JSONStream in;
input_string_parser_L3_00_inst: student_schema_parser.t<5>.JSONStream in;
input_string_parser_L3_01_inst: student_schema_parser.t<5>.JSONStream in;
input_string_parser_L3_02_inst: student_schema_parser.t<5>.JSONStream in;
input_int_parser_L4_00_inst: student_schema_parser.t<4>.IntParserStream in;
output: StudentStream out;
}
impl StudentFilterImpl of StudentFilterInterface {}
Float32 = Bit(32);
SimilarityVectorStream = Stream(Float32, t=64.0, d=1, c=1);
streamlet SimilarityEncoderInterface {
# Student data structure input. #
student_input: StudentStream in;
# Student similarity vector output. #
similarity_output: SimilarityVectorStream out;
}
impl SimilarityEncoderImpl of SimilarityEncoderInterface @External {}
impl TydiDemoTop of TydiDemoTop_Interface {
instance decompressor(snappy.VhSnUnzipUnbufferedWrap);
instance json_parser(student_schema_parser.top_impl);
instance student_filter(StudentFilterImpl);
instance similarity_encoder(SimilarityEncoderImpl);
input => decompressor.co;
// There is a dimensionality mismatch here
// Also one uses Byte_t where the other uses Byte because they are from different packages.
decompressor.de => json_parser.input;
json_parser.output_string_parser_L1_00_inst => student_filter.input_string_parser_L1_00_inst;
json_parser.output_string_parser_L1_01_inst => student_filter.input_string_parser_L1_01_inst;
json_parser.output_string_parser_L1_02_inst => student_filter.input_string_parser_L1_02_inst;
json_parser.output_string_parser_L1_03_inst => student_filter.input_string_parser_L1_03_inst;
json_parser.output_key_parser_L2_04_inst => student_filter.input_key_parser_L2_04_inst;
json_parser.output_string_parser_L1_04_inst => student_filter.input_string_parser_L1_04_inst;
json_parser.output_string_parser_L1_05_inst => student_filter.input_string_parser_L1_05_inst;
json_parser.output_string_parser_L3_00_inst => student_filter.input_string_parser_L3_00_inst;
json_parser.output_string_parser_L3_01_inst => student_filter.input_string_parser_L3_01_inst;
json_parser.output_string_parser_L3_02_inst => student_filter.input_string_parser_L3_02_inst;
json_parser.output_int_parser_L4_00_inst => student_filter.input_int_parser_L4_00_inst;
student_filter.output => similarity_encoder.student_input;
similarity_encoder.similarity_output => output;
}