@@ -130,6 +130,10 @@ cc_library(
130130 ],
131131 deps = [
132132 ":arch-xc7-frame" ,
133+ "//fpga:database-parsers" ,
134+ "//fpga:memory-mapped-file" ,
135+ "@abseil-cpp//absl/log:check" ,
136+ "@abseil-cpp//absl/status:statusor" ,
133137 ],
134138)
135139
@@ -206,15 +210,106 @@ cc_test(
206210 srcs = [
207211 "configuration-xc7_test.cc" ,
208212 ],
213+ data = [
214+ "testdata/xc7-configuration.bit" ,
215+ "testdata/xc7-configuration.debug.bit" ,
216+ "testdata/xc7-configuration.perframecrc.bit" ,
217+ "testdata/xc7-configuration-test.json" ,
218+ ],
209219 deps = [
210220 ":arch-types" ,
211221 ":arch-xc7-frame" ,
222+ ":bitstream-reader" ,
212223 ":configuration" ,
213224 ":configuration-packet" ,
214225 ":frames" ,
226+ "//fpga:database-parsers" ,
227+ "//fpga:memory-mapped-file" ,
228+ "@abseil-cpp//absl/status:statusor" ,
215229 "@abseil-cpp//absl/types:optional" ,
216230 "@abseil-cpp//absl/types:span" ,
217231 "@googletest//:gtest" ,
218232 "@googletest//:gtest_main" ,
219233 ],
220234)
235+
236+ cc_library (
237+ name = "bitstream-reader" ,
238+ hdrs = [
239+ "bitstream-reader.h" ,
240+ ],
241+ deps = [
242+ ":arch-types" ,
243+ ":big-endian-span" ,
244+ "@abseil-cpp//absl/types:optional" ,
245+ "@abseil-cpp//absl/types:span" ,
246+ ],
247+ )
248+
249+ cc_test (
250+ name = "bitstream-reader_test" ,
251+ srcs = [
252+ "bitstream-reader-xc7_test.cc" ,
253+ ],
254+ deps = [
255+ ":arch-types" ,
256+ ":bitstream-reader" ,
257+ "@abseil-cpp//absl/types:span" ,
258+ "@googletest//:gtest_main" ,
259+ ],
260+ )
261+
262+ cc_library (
263+ name = "bitstream-writer" ,
264+ srcs = [
265+ "bitstream-writer.cc" ,
266+ ],
267+ hdrs = [
268+ "bitstream-writer.h" ,
269+ ],
270+ deps = [
271+ ":arch-types" ,
272+ ":arch-xc7-configuration-packet" ,
273+ ":bit-ops" ,
274+ ":configuration-packet" ,
275+ "@abseil-cpp//absl/log:check" ,
276+ "@abseil-cpp//absl/strings" ,
277+ "@abseil-cpp//absl/time" ,
278+ "@abseil-cpp//absl/types:optional" ,
279+ "@abseil-cpp//absl/types:span" ,
280+ ],
281+ )
282+
283+ cc_test (
284+ name = "bitstream-writer_test" ,
285+ srcs = [
286+ "bitstream-writer_test.cc" ,
287+ ],
288+ deps = [
289+ ":arch-types" ,
290+ ":arch-xc7-configuration-packet" ,
291+ ":bit-ops" ,
292+ ":bitstream-writer" ,
293+ ":configuration-packet" ,
294+ "@abseil-cpp//absl/types:span" ,
295+ "@googletest//:gtest" ,
296+ "@googletest//:gtest_main" ,
297+ ],
298+ )
299+
300+ cc_library (
301+ name = "bitstream" ,
302+ hdrs = [
303+ "bitstream.h" ,
304+ ],
305+ deps = [
306+ ":arch-types" ,
307+ ":bitstream-writer" ,
308+ ":configuration" ,
309+ ":frames" ,
310+ "//fpga:database-parsers" ,
311+ "@abseil-cpp//absl/status" ,
312+ "@abseil-cpp//absl/status:statusor" ,
313+ "@abseil-cpp//absl/strings:string_view" ,
314+ ],
315+ )
0 commit comments