@@ -47,6 +47,25 @@ def yosys_vhdl_synth(ctx):
47
47
}
48
48
in_json_file = ctx .actions .write_json ("yosys_synth_input.json" , out_json , with_inputs = True )
49
49
50
+ # Dump some register map stuff
51
+ maps = []
52
+ json_maps = ctx .attrs .top .get (RDLJsonMaps )
53
+ if json_maps != None :
54
+ for file in json_maps .files :
55
+ new_file = ctx .actions .declare_output ("maps" , file .basename )
56
+ maps .append (ctx .actions .copy_file (new_file , file ))
57
+ html_maps = ctx .attrs .top .get (RDLHtmlMaps )
58
+ if html_maps != None :
59
+ for file in html_maps .files :
60
+ new_file = ctx .actions .declare_output ("maps" , file .basename )
61
+ maps .append (ctx .actions .copy_file (new_file , file ))
62
+
63
+ # This is a bit sketchy but we're declaring any maps as hidden inputs
64
+ # here to force the generation of these files since nothing downstream
65
+ # depends on them. Buck2 is too smart such that since nothing depends
66
+ # on them, it doesn't even build them
67
+ # This is a bit of a hack but it works for now.
68
+
50
69
yosys_py = ctx .actions .declare_output ("synth.py" )
51
70
52
71
yosys_gen = ctx .attrs ._yosys_gen [RunInfo ]
@@ -57,7 +76,7 @@ def yosys_vhdl_synth(ctx):
57
76
58
77
ctx .actions .run (cmd , category = "yosys_synth_gen" )
59
78
60
- yosys_synth_cmd = cmd_args (hidden = in_json_file )
79
+ yosys_synth_cmd = cmd_args (hidden = [ in_json_file , maps ] )
61
80
yosys_synth_cmd .add (ctx .attrs ._python [PythonToolchainInfo ].interpreter )
62
81
yosys_synth_cmd .add (yosys_py )
63
82
yosys_synth_cmd .add ("--output" , yosys_json .as_output ())
0 commit comments