CCSDS TM Transfer Frames (CCSDS 132.0-B-3)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor: rename d3t to wire across codebase

Rename the d3t library to wire for clarity. Update all references
in bench, test, and library code across affected packages.

+41 -41
+16 -16
bench/bench_tm.ml
··· 1 - (** Benchmark comparing original Tm header encode/decode vs D3t Codec. 1 + (** Benchmark comparing original Tm header encode/decode vs Wire Codec. 2 2 3 3 Both operate on the same 6-byte TM Transfer Frame primary header. *) 4 4 ··· 38 38 match Tm.decode_header s with Ok h -> h | Error _ -> assert false) 39 39 test_headers_str 40 40 41 - let test_d3t_headers = Array.map (fun b -> Tm_d3t.decode_exn b 0) test_headers 41 + let test_wire_headers = Array.map (fun b -> Tm_wire.decode_exn b 0) test_headers 42 42 43 43 (** {1 Original Tm (string-based)} *) 44 44 ··· 63 63 | Error _ -> () 64 64 done 65 65 66 - (** {1 D3t Codec (bytes-based)} *) 66 + (** {1 Wire Codec (bytes-based)} *) 67 67 68 - let d3t_decode () = 68 + let wire_decode () = 69 69 for i = 0 to Array.length test_headers - 1 do 70 - let _ = Tm_d3t.decode_exn test_headers.(i) 0 in 70 + let _ = Tm_wire.decode_exn test_headers.(i) 0 in 71 71 () 72 72 done 73 73 74 - let d3t_encode () = 75 - for i = 0 to Array.length test_d3t_headers - 1 do 74 + let wire_encode () = 75 + for i = 0 to Array.length test_wire_headers - 1 do 76 76 let buf = Bytes.create 6 in 77 - Tm_d3t.encode test_d3t_headers.(i) buf 0; 77 + Tm_wire.encode test_wire_headers.(i) buf 0; 78 78 let _ = buf in 79 79 () 80 80 done 81 81 82 - let d3t_roundtrip () = 82 + let wire_roundtrip () = 83 83 for i = 0 to Array.length test_headers - 1 do 84 - let t = Tm_d3t.decode_exn test_headers.(i) 0 in 84 + let t = Tm_wire.decode_exn test_headers.(i) 0 in 85 85 let buf = Bytes.create 6 in 86 - Tm_d3t.encode t buf 0; 86 + Tm_wire.encode t buf 0; 87 87 let _ = buf in 88 88 () 89 89 done ··· 110 110 words_per_iter 111 111 112 112 let () = 113 - Printf.printf "TM Header Benchmark: original vs d3t\n"; 113 + Printf.printf "TM Header Benchmark: original vs wire\n"; 114 114 Printf.printf "=====================================\n"; 115 115 Printf.printf "(processing 1000 headers per iteration)\n\n"; 116 116 ··· 120 120 time_it "roundtrip" 1000 original_roundtrip; 121 121 Printf.printf "\n"; 122 122 123 - Printf.printf "D3t Codec (bytes-based):\n"; 124 - time_it "decode" 1000 d3t_decode; 125 - time_it "encode" 1000 d3t_encode; 126 - time_it "roundtrip" 1000 d3t_roundtrip; 123 + Printf.printf "Wire Codec (bytes-based):\n"; 124 + time_it "decode" 1000 wire_decode; 125 + time_it "encode" 1000 wire_encode; 126 + time_it "roundtrip" 1000 wire_roundtrip; 127 127 Printf.printf "\n"
+1 -1
bench/dune
··· 1 1 (executable 2 2 (name bench_tm) 3 3 (modules bench_tm) 4 - (libraries tm tm-d3t unix)) 4 + (libraries tm tm-wire unix))
+4 -4
dune-project
··· 24 24 (crowbar :with-test))) 25 25 26 26 (package 27 - (name tm-d3t) 28 - (synopsis "D3t codec for CCSDS TM Transfer Frame headers") 27 + (name tm-wire) 28 + (synopsis "Wire codec for CCSDS TM Transfer Frame headers") 29 29 (description 30 - "D3t-based codec for TM Transfer Frame primary headers. Provides \ 30 + "Wire-based codec for TM Transfer Frame primary headers. Provides \ 31 31 a compositional codec, EverParse 3D schema generation, and conversion \ 32 32 to/from the hand-written Tm.header type.") 33 33 (depends 34 34 (ocaml (>= 4.14)) 35 35 (tm (= :version)) 36 - (d3t (>= 0.1)))) 36 + (wire (>= 0.1))))
+3 -3
lib/wire/dune
··· 1 1 (library 2 - (name tm_d3t) 3 - (public_name tm-d3t) 4 - (libraries tm d3t)) 2 + (name tm_wire) 3 + (public_name tm-wire) 4 + (libraries tm wire))
+5 -5
lib/wire/tm_wire.ml
··· 1 - (** TM Transfer Frame Header using D3t schemas. 1 + (** TM Transfer Frame Header using Wire schemas. 2 2 3 3 The 6-byte primary header is modeled as three uint16be words: 4 4 {v ··· 20 20 Bits 0-10: First Header Pointer (11 bits) 21 21 v} *) 22 22 23 - open D3t 23 + open Wire 24 24 25 25 (** {1 Types} *) 26 26 ··· 42 42 let seg_len_id t = (t.w2 lsr 11) land 0x3 43 43 let first_hdr_ptr t = t.w2 land 0x7FF 44 44 45 - (** {1 D3t Codec} *) 45 + (** {1 Wire Codec} *) 46 46 47 47 let codec = 48 48 let open Codec in ··· 57 57 let struct_ = Codec.to_struct codec 58 58 59 59 let module_ = 60 - D3t.module_ ~doc:"CCSDS TM Transfer Frame Primary Header (132.0-B-3)" 60 + Wire.module_ ~doc:"CCSDS TM Transfer Frame Primary Header (132.0-B-3)" 61 61 "TmHeader" 62 - [ D3t.typedef ~entrypoint:true struct_ ] 62 + [ Wire.typedef ~entrypoint:true struct_ ] 63 63 64 64 (** {1 Parse/Encode} *) 65 65
+9 -9
lib/wire/tm_wire.mli
··· 1 - (** TM Transfer Frame Header using D3t schemas. 1 + (** TM Transfer Frame Header using Wire schemas. 2 2 3 - This module provides a D3t-based implementation of the CCSDS TM Transfer 3 + This module provides a Wire-based implementation of the CCSDS TM Transfer 4 4 Frame Primary Header (CCSDS 132.0-B-3) for differential testing against the 5 5 hand-written implementation. 6 6 ··· 55 55 val first_hdr_ptr : t -> int 56 56 (** First header pointer (bits 5-15 of word 2, 11 bits). *) 57 57 58 - (** {1 D3t Codec} *) 58 + (** {1 Wire Codec} *) 59 59 60 - val codec : t D3t.Codec.t 60 + val codec : t Wire.Codec.t 61 61 (** Record codec for parsing/encoding. *) 62 62 63 - val struct_ : D3t.struct_ 64 - (** D3t struct definition. *) 63 + val struct_ : Wire.struct_ 64 + (** Wire struct definition. *) 65 65 66 - val module_ : D3t.module_ 67 - (** D3t module for 3D generation. *) 66 + val module_ : Wire.module_ 67 + (** Wire module for 3D generation. *) 68 68 69 69 (** {1 Parse/Encode} *) 70 70 71 71 val decode_exn : bytes -> int -> t 72 72 (** [decode_exn buf offset] decodes with bounds checking. Raises 73 - {!D3t.Parse_error} if buffer too short. *) 73 + {!Wire.Parse_error} if buffer too short. *) 74 74 75 75 val encode : t -> bytes -> int -> unit 76 76 (** [encode t buf offset] encodes into [buf] at [offset]. *)
+3 -3
tm-d3t.opam tm-wire.opam
··· 1 1 # This file is generated by dune, edit dune-project instead 2 2 opam-version: "2.0" 3 - synopsis: "D3t codec for CCSDS TM Transfer Frame headers" 3 + synopsis: "Wire codec for CCSDS TM Transfer Frame headers" 4 4 description: 5 - "D3t-based codec for TM Transfer Frame primary headers. Provides a compositional codec, EverParse 3D schema generation, and conversion to/from the hand-written Tm.header type." 5 + "Wire-based codec for TM Transfer Frame primary headers. Provides a compositional codec, EverParse 3D schema generation, and conversion to/from the hand-written Tm.header type." 6 6 maintainer: ["Thomas Gazagnaire <thomas@gazagnaire.org>"] 7 7 authors: ["Thomas Gazagnaire <thomas@gazagnaire.org>"] 8 8 license: "MIT" ··· 12 12 "dune" {>= "3.21"} 13 13 "ocaml" {>= "4.14"} 14 14 "tm" {= version} 15 - "d3t" {>= "0.1"} 15 + "wire" {>= "0.1"} 16 16 "odoc" {with-doc} 17 17 ] 18 18 build: [