File tree 6 files changed +64
-0
lines changed
6 files changed +64
-0
lines changed Original file line number Diff line number Diff line change
1
+ [repositories]
2
+ root = .
3
+ prelude = prelude
4
+ toolchains = toolchains
5
+ none = none
6
+
7
+ [repository_aliases]
8
+ config = prelude
9
+ fbcode = none
10
+ fbsource = none
11
+ buck = none
12
+
13
+ [parser]
14
+ target_platform_detector_spec = target:root//...->prelude//platforms:default
15
+
16
+ [project]
17
+ ignore = .git
Original file line number Diff line number Diff line change 1
1
[submodule "vnd/cobalt "]
2
2
path = vnd/cobalt
3
3
url = git@github.com:oxidecomputer/cobalt.git
4
+ [submodule "prelude "]
5
+ path = prelude
6
+ url = https://github.com/facebook/buck2-prelude.git
Original file line number Diff line number Diff line change
1
+ load (":rdl.bzl" , "rdl_file" , "rdl_gen" )
2
+ rdl_file (
3
+ name = "gimlet_regs_rdl" ,
4
+ src = "gimlet_seq_fpga_regs.rdl"
5
+ )
6
+
7
+ rdl_gen (
8
+ name = "rdl_test" ,
9
+ srcs = [":gimlet_regs_rdl" ],
10
+ outputs = ["test_pkg.vhd" , "test.html" ]
11
+ )
Original file line number Diff line number Diff line change
1
+ def _rdl_file_impl (ctx ):
2
+ return [DefaultInfo (default_output = ctx .attrs .src .without_associated_artifacts ())]
3
+
4
+ rdl_file = rule (
5
+ impl = _rdl_file_impl ,
6
+ attrs = {
7
+ "src" : attrs .source ()
8
+ }
9
+ )
10
+
11
+ def _rdl_gen_impl (ctx ):
12
+ outs = [ctx .actions .declare_output (out ) for out in ctx .attrs .outputs ]
13
+ print (ctx .attrs .srcs )
14
+ ctx .actions .run ([
15
+ "python3" ,
16
+ "../cobalt/tools/site_cobble/rdl_pkg/rdl_cli.py" ,
17
+ "--inputs" , [x for x in ctx .attrs .srcs ],
18
+ "--outputs" , [x .as_output () for x in outs ],
19
+ ],
20
+ category = "rdl" ,
21
+
22
+ )
23
+
24
+ return [DefaultInfo (default_outputs = outs )]
25
+
26
+ rdl_gen = rule (
27
+ impl = _rdl_gen_impl ,
28
+ attrs = {
29
+ "srcs" : attrs .list (attrs .source ()),
30
+ "outputs" : attrs .list (attrs .string ())
31
+ }
32
+ )
You can’t perform that action at this time.
0 commit comments