Skip to content

Commit

Permalink
[bitstreams] Collect MMI data into a single file
Browse files Browse the repository at this point in the history
Rev up the JSON schema to require MMI data in a single file.
Add support to rev up v2 manifests to v3.
Remove support for cache entries that do not have manifests.

Signed-off-by: Alexander Williams <[email protected]>
  • Loading branch information
a-will committed Nov 27, 2024
1 parent 34bb743 commit 6f66b14
Show file tree
Hide file tree
Showing 22 changed files with 491 additions and 818 deletions.
110 changes: 13 additions & 97 deletions hw/bitstream/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -70,97 +70,13 @@ filegroup(
)

filegroup(
name = "rom_mmi",
name = "cw310_mmi",
testonly = True,
srcs = select({
"bitstream_skip": ["//hw/bitstream/universal:none"],
"bitstream_vivado": ["//hw/bitstream/vivado:rom_mmi"],
"bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw310_rom_mmi"],
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw310_rom_mmi"],
}),
tags = ["manual"],
)

filegroup(
name = "otp_mmi",
testonly = True,
srcs = select({
"bitstream_skip": ["//hw/bitstream/universal:none"],
"bitstream_vivado": ["//hw/bitstream/vivado:otp_mmi"],
"bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw310_otp_mmi"],
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw310_otp_mmi"],
}),
tags = ["manual"],
)

filegroup(
name = "flash0_info0_mmi",
testonly = True,
srcs = select({
"bitstream_skip": ["//hw/bitstream/universal:none"],
"bitstream_vivado": ["//hw/bitstream/vivado:flash0_info0_mmi"],
"bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw310_flash0_info0_mmi"],
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw310_flash0_info0_mmi"],
}),
tags = ["manual"],
)

filegroup(
name = "flash0_info1_mmi",
testonly = True,
srcs = select({
"bitstream_skip": ["//hw/bitstream/universal:none"],
"bitstream_vivado": ["//hw/bitstream/vivado:flash0_info1_mmi"],
"bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw310_flash0_info1_mmi"],
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw310_flash0_info1_mmi"],
}),
tags = ["manual"],
)

filegroup(
name = "flash0_info2_mmi",
testonly = True,
srcs = select({
"bitstream_skip": ["//hw/bitstream/universal:none"],
"bitstream_vivado": ["//hw/bitstream/vivado:flash0_info2_mmi"],
"bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw310_flash0_info2_mmi"],
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw310_flash0_info2_mmi"],
}),
tags = ["manual"],
)

filegroup(
name = "flash1_info0_mmi",
testonly = True,
srcs = select({
"bitstream_skip": ["//hw/bitstream/universal:none"],
"bitstream_vivado": ["//hw/bitstream/vivado:flash1_info0_mmi"],
"bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw310_flash1_info0_mmi"],
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw310_flash1_info0_mmi"],
}),
tags = ["manual"],
)

filegroup(
name = "flash1_info1_mmi",
testonly = True,
srcs = select({
"bitstream_skip": ["//hw/bitstream/universal:none"],
"bitstream_vivado": ["//hw/bitstream/vivado:flash1_info1_mmi"],
"bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw310_flash1_info1_mmi"],
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw310_flash1_info1_mmi"],
}),
tags = ["manual"],
)

filegroup(
name = "flash1_info2_mmi",
testonly = True,
srcs = select({
"bitstream_skip": ["//hw/bitstream/universal:none"],
"bitstream_vivado": ["//hw/bitstream/vivado:flash1_info2_mmi"],
"bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw310_flash1_info2_mmi"],
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw310_flash1_info2_mmi"],
"bitstream_vivado": ["//hw/bitstream/vivado:cw310_mmi"],
"bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw310_mmi"],
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw310_mmi"],
}),
tags = ["manual"],
)
Expand All @@ -171,7 +87,8 @@ bitstream_splice(
testonly = True,
src = ":bitstream",
data = "//sw/device/lib/testing/test_rom:test_rom_fpga_cw310_scr_vmem",
meminfo = ":rom_mmi",
instance = "rom",
meminfo = ":cw310_mmi",
tags = ["manual"],
update_usr_access = True,
)
Expand All @@ -181,7 +98,8 @@ bitstream_splice(
testonly = True,
src = ":bitstream",
data = "//sw/device/silicon_creator/rom:mask_rom_fpga_cw310_scr_vmem",
meminfo = ":rom_mmi",
instance = "rom",
meminfo = ":cw310_mmi",
tags = ["manual"],
update_usr_access = True,
)
Expand All @@ -193,7 +111,8 @@ bitstream_splice(
testonly = True,
src = ":mask_rom",
data = img_target,
meminfo = ":otp_mmi",
instance = "otp",
meminfo = ":cw310_mmi",
tags = ["manual"],
update_usr_access = True,
)
Expand All @@ -205,8 +124,7 @@ bitstream_fragment_from_manifest(
name = "chip_earlgrey_cw310_cached_fragment",
srcs = [
"@bitstreams//:chip_earlgrey_cw310_bitstream",
"@bitstreams//:chip_earlgrey_cw310_otp_mmi",
"@bitstreams//:chip_earlgrey_cw310_rom_mmi",
"@bitstreams//:chip_earlgrey_cw310_mmi",
],
design = "chip_earlgrey_cw310",
manifest = "@bitstreams//:manifest",
Expand All @@ -227,8 +145,7 @@ bitstream_fragment_from_manifest(
name = "chip_earlgrey_cw310_hyperdebug_cached_fragment",
srcs = [
"@bitstreams//:chip_earlgrey_cw310_hyperdebug_bitstream",
"@bitstreams//:chip_earlgrey_cw310_hyperdebug_otp_mmi",
"@bitstreams//:chip_earlgrey_cw310_hyperdebug_rom_mmi",
"@bitstreams//:chip_earlgrey_cw310_hyperdebug_mmi",
],
design = "chip_earlgrey_cw310_hyperdebug",
manifest = "@bitstreams//:manifest",
Expand All @@ -249,8 +166,7 @@ bitstream_fragment_from_manifest(
name = "chip_earlgrey_cw340_cached_fragment",
srcs = [
"@bitstreams//:chip_earlgrey_cw340_bitstream",
"@bitstreams//:chip_earlgrey_cw340_otp_mmi",
"@bitstreams//:chip_earlgrey_cw340_rom_mmi",
"@bitstreams//:chip_earlgrey_cw340_mmi",
],
design = "chip_earlgrey_cw340",
manifest = "@bitstreams//:manifest",
Expand Down
101 changes: 10 additions & 91 deletions hw/bitstream/cw340/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -25,97 +25,13 @@ filegroup(
)

filegroup(
name = "rom_mmi",
name = "mmi",
testonly = True,
srcs = select({
"//hw/bitstream:bitstream_skip": ["//hw/bitstream/universal:none"],
"//hw/bitstream:bitstream_vivado": ["//hw/bitstream/vivado:fpga_cw340_rom_mmi"],
"//hw/bitstream:bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw340_rom_mmi"],
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw340_rom_mmi"],
}),
tags = ["manual"],
)

filegroup(
name = "otp_mmi",
testonly = True,
srcs = select({
"//hw/bitstream:bitstream_skip": ["//hw/bitstream/universal:none"],
"//hw/bitstream:bitstream_vivado": ["//hw/bitstream/vivado:fpga_cw340_otp_mmi"],
"//hw/bitstream:bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw340_otp_mmi"],
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw340_otp_mmi"],
}),
tags = ["manual"],
)

filegroup(
name = "flash0_info0_mmi",
testonly = True,
srcs = select({
"//hw/bitstream:bitstream_skip": ["//hw/bitstream/universal:none"],
"//hw/bitstream:bitstream_vivado": ["//hw/bitstream/vivado:fpga_cw340_flash0_info0_mmi"],
"//hw/bitstream:bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw340_flash0_info0_mmi"],
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw340_flash0_info0_mmi"],
}),
tags = ["manual"],
)

filegroup(
name = "flash0_info1_mmi",
testonly = True,
srcs = select({
"//hw/bitstream:bitstream_skip": ["//hw/bitstream/universal:none"],
"//hw/bitstream:bitstream_vivado": ["//hw/bitstream/vivado:fpga_cw340_flash0_info1_mmi"],
"//hw/bitstream:bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw340_flash0_info1_mmi"],
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw340_flash0_info1_mmi"],
}),
tags = ["manual"],
)

filegroup(
name = "flash0_info2_mmi",
testonly = True,
srcs = select({
"//hw/bitstream:bitstream_skip": ["//hw/bitstream/universal:none"],
"//hw/bitstream:bitstream_vivado": ["//hw/bitstream/vivado:fpga_cw340_flash0_info2_mmi"],
"//hw/bitstream:bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw340_flash0_info2_mmi"],
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw340_flash0_info2_mmi"],
}),
tags = ["manual"],
)

filegroup(
name = "flash1_info0_mmi",
testonly = True,
srcs = select({
"//hw/bitstream:bitstream_skip": ["//hw/bitstream/universal:none"],
"//hw/bitstream:bitstream_vivado": ["//hw/bitstream/vivado:fpga_cw340_flash1_info0_mmi"],
"//hw/bitstream:bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw340_flash1_info0_mmi"],
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw340_flash1_info0_mmi"],
}),
tags = ["manual"],
)

filegroup(
name = "flash1_info1_mmi",
testonly = True,
srcs = select({
"//hw/bitstream:bitstream_skip": ["//hw/bitstream/universal:none"],
"//hw/bitstream:bitstream_vivado": ["//hw/bitstream/vivado:fpga_cw340_flash1_info1_mmi"],
"//hw/bitstream:bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw340_flash1_info1_mmi"],
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw340_flash1_info1_mmi"],
}),
tags = ["manual"],
)

filegroup(
name = "flash1_info2_mmi",
testonly = True,
srcs = select({
"//hw/bitstream:bitstream_skip": ["//hw/bitstream/universal:none"],
"//hw/bitstream:bitstream_vivado": ["//hw/bitstream/vivado:fpga_cw340_flash1_info2_mmi"],
"//hw/bitstream:bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw340_flash1_info2_mmi"],
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw340_flash1_info2_mmi"],
"//hw/bitstream:bitstream_vivado": ["//hw/bitstream/vivado:fpga_cw340_mmi"],
"//hw/bitstream:bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw340_mmi"],
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw340_mmi"],
}),
tags = ["manual"],
)
Expand All @@ -126,7 +42,8 @@ bitstream_splice(
testonly = True,
src = ":bitstream",
data = "//sw/device/lib/testing/test_rom:test_rom_fpga_cw340_scr_vmem",
meminfo = ":rom_mmi",
instance = "rom",
meminfo = ":mmi",
tags = ["manual"],
update_usr_access = True,
)
Expand All @@ -137,7 +54,8 @@ bitstream_splice(
testonly = True,
src = ":bitstream",
data = "//sw/device/silicon_creator/rom:mask_rom_fpga_cw340_scr_vmem",
meminfo = ":rom_mmi",
instance = "rom",
meminfo = ":mmi",
tags = ["manual"],
update_usr_access = True,
)
Expand All @@ -149,7 +67,8 @@ bitstream_splice(
testonly = True,
src = ":mask_rom",
data = img_target,
meminfo = ":otp_mmi",
instance = "otp",
meminfo = ":mmi",
tags = ["manual"],
update_usr_access = True,
)
Expand Down
Loading

0 comments on commit 6f66b14

Please sign in to comment.