xlsynth_sys/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2
3//! Declarations for the C API for the XLS dynamic shared object.
4
5extern crate libc;
6
7#[repr(C)]
8pub struct CIrValue {
9    _private: [u8; 0], // Ensures the struct cannot be instantiated
10}
11
12#[repr(C)]
13pub struct CIrBits {
14    _private: [u8; 0], // Ensures the struct cannot be instantiated
15}
16
17#[repr(C)]
18pub struct CBitsRope {
19    _private: [u8; 0], // Ensures the struct cannot be instantiated
20}
21
22#[repr(C)]
23pub struct CIrPackage {
24    _private: [u8; 0], // Ensures the struct cannot be instantiated
25}
26
27#[repr(C)]
28pub struct CIrFunction {
29    _private: [u8; 0], // Ensures the struct cannot be instantiated
30}
31
32#[repr(C)]
33pub struct CIrFunctionBase {
34    _private: [u8; 0], // Ensures the struct cannot be instantiated
35}
36
37#[repr(C)]
38pub struct CIrFunctionJit {
39    _private: [u8; 0], // Ensures the struct cannot be instantiated
40}
41
42#[repr(C)]
43pub struct CTraceMessage {
44    pub message: *mut std::os::raw::c_char,
45    pub verbosity: i64,
46}
47
48#[repr(C)]
49pub struct CIrType {
50    _private: [u8; 0], // Ensures the struct cannot be instantiated
51}
52
53#[repr(C)]
54pub struct CIrFunctionType {
55    _private: [u8; 0], // Ensures the struct cannot be instantiated
56}
57
58// "VAST" is the "Verilog AST" API which
59#[repr(C)]
60pub struct CVastFile {
61    _private: [u8; 0], // Ensures the struct cannot be instantiated
62}
63
64#[repr(C)]
65pub struct CVastModule {
66    _private: [u8; 0], // Ensures the struct cannot be instantiated
67}
68
69#[repr(C)]
70pub struct CVastDataType {
71    _private: [u8; 0], // Ensures the struct cannot be instantiated
72}
73
74#[repr(C)]
75pub struct CVastExpression {
76    _private: [u8; 0], // Ensures the struct cannot be instantiated
77}
78
79#[repr(C)]
80pub struct CVastLiteral {
81    _private: [u8; 0], // Ensures the struct cannot be instantiated
82}
83
84#[repr(C)]
85pub struct CVastConcat {
86    _private: [u8; 0], // Ensures the struct cannot be instantiated
87}
88
89#[repr(C)]
90pub struct CVastMacroRef {
91    _private: [u8; 0], // Ensures the struct cannot be instantiated
92}
93
94#[repr(C)]
95pub struct CVastMacroStatement {
96    _private: [u8; 0], // Ensures the struct cannot be instantiated
97}
98
99#[repr(C)]
100pub struct CVastComment {
101    _private: [u8; 0], // Ensures the struct cannot be instantiated
102}
103
104#[repr(C)]
105pub struct CVastBlankLine {
106    _private: [u8; 0], // Ensures the struct cannot be instantiated
107}
108
109#[repr(C)]
110pub struct CVastInlineVerilogStatement {
111    _private: [u8; 0], // Ensures the struct cannot be instantiated
112}
113
114#[repr(C)]
115pub struct CVastLogicRef {
116    _private: [u8; 0], // Ensures the struct cannot be instantiated
117}
118
119#[repr(C)]
120pub struct CVastInstantiation {
121    _private: [u8; 0], // Ensures the struct cannot be instantiated
122}
123
124#[repr(C)]
125pub struct CVastContinuousAssignment {
126    _private: [u8; 0], // Ensures the struct cannot be instantiated
127}
128
129#[repr(C)]
130pub struct CVastSlice {
131    _private: [u8; 0], // Ensures the struct cannot be instantiated
132}
133
134#[repr(C)]
135pub struct CVastIndex {
136    _private: [u8; 0], // Ensures the struct cannot be instantiated
137}
138
139#[repr(C)]
140pub struct CVastIndexableExpression {
141    _private: [u8; 0], // Ensures the struct cannot be instantiated
142}
143
144#[repr(C)]
145pub struct CVastAlwaysBase {
146    _private: [u8; 0], // Ensures the struct cannot be instantiated
147}
148
149#[repr(C)]
150pub struct CVastStatementBlock {
151    _private: [u8; 0], // Ensures the struct cannot be instantiated
152}
153
154#[repr(C)]
155pub struct CVastStatement {
156    _private: [u8; 0], // Ensures the struct cannot be instantiated
157}
158
159#[repr(C)]
160pub struct CVastConditional {
161    _private: [u8; 0], // Ensures the struct cannot be instantiated
162}
163
164#[repr(C)]
165pub struct CVastCaseStatement {
166    _private: [u8; 0], // Ensures the struct cannot be instantiated
167}
168
169#[repr(C)]
170pub struct CVastParameterRef {
171    _private: [u8; 0], // Ensures the struct cannot be instantiated
172}
173
174#[repr(C)]
175pub struct CVastLocalparamRef {
176    _private: [u8; 0], // Ensures the struct cannot be instantiated
177}
178
179#[repr(C)]
180pub struct CVastGenerateLoop {
181    _private: [u8; 0], // Ensures the struct cannot be instantiated
182}
183
184// -- DSLX
185
186#[repr(C)]
187pub struct CDslxImportData {
188    _private: [u8; 0], // Ensures the struct cannot be instantiated
189}
190
191#[repr(C)]
192pub struct CDslxTypecheckedModule {
193    _private: [u8; 0], // Ensures the struct cannot be instantiated
194}
195
196#[repr(C)]
197pub struct CDslxModule {
198    _private: [u8; 0], // Ensures the struct cannot be instantiated
199}
200
201#[repr(C)]
202pub struct CDslxTypeInfo {
203    _private: [u8; 0], // Ensures the struct cannot be instantiated
204}
205
206#[repr(C)]
207pub struct CDslxStructDef {
208    _private: [u8; 0], // Ensures the struct cannot be instantiated
209}
210
211#[repr(C)]
212pub struct CDslxEnumDef {
213    _private: [u8; 0], // Ensures the struct cannot be instantiated
214}
215
216#[repr(C)]
217pub struct CDslxTypeAlias {
218    _private: [u8; 0], // Ensures the struct cannot be instantiated
219}
220
221#[repr(C)]
222pub struct CDslxType {
223    _private: [u8; 0], // Ensures the struct cannot be instantiated
224}
225
226#[repr(C)]
227pub struct CDslxTypeDim {
228    _private: [u8; 0], // Ensures the struct cannot be instantiated
229}
230
231#[repr(C)]
232pub struct CDslxExpr {
233    _private: [u8; 0], // Ensures the struct cannot be instantiated
234}
235
236#[repr(C)]
237pub struct CDslxInterpValue {
238    _private: [u8; 0], // Ensures the struct cannot be instantiated
239}
240
241#[repr(C)]
242pub struct CDslxParametricEnv {
243    _private: [u8; 0], // Ensures the struct cannot be instantiated
244}
245
246#[repr(C)]
247pub struct CDslxEnumMember {
248    _private: [u8; 0], // Ensures the struct cannot be instantiated
249}
250
251#[repr(C)]
252pub struct CDslxStructMember {
253    _private: [u8; 0], // Ensures the struct cannot be instantiated
254}
255
256#[repr(C)]
257pub struct CDslxTypeAnnotation {
258    _private: [u8; 0], // Ensures the struct cannot be instantiated
259}
260
261#[repr(C)]
262pub struct CDslxTypeRefTypeAnnotation {
263    _private: [u8; 0], // Ensures the struct cannot be instantiated
264}
265
266#[repr(C)]
267pub struct CDslxTypeRef {
268    _private: [u8; 0], // Ensures the struct cannot be instantiated
269}
270
271#[repr(C)]
272pub struct CDslxImport {
273    _private: [u8; 0], // Ensures the struct cannot be instantiated
274}
275
276#[repr(C)]
277pub struct CDslxColonRef {
278    _private: [u8; 0], // Ensures the struct cannot be instantiated
279}
280
281#[repr(C)]
282pub struct CDslxTypeDefinition {
283    _private: [u8; 0], // Ensures the struct cannot be instantiated
284}
285
286#[repr(C)]
287pub struct CDslxConstantDef {
288    _private: [u8; 0], // Ensures the struct cannot be instantiated
289}
290
291#[repr(C)]
292pub struct CDslxModuleMember {
293    _private: [u8; 0], // Ensures the struct cannot be instantiated
294}
295
296#[repr(C)]
297pub struct CDslxFunction {
298    _private: [u8; 0], // Ensures the struct cannot be instantiated
299}
300
301#[repr(C)]
302pub struct CDslxParam {
303    _private: [u8; 0], // Ensures the struct cannot be instantiated
304}
305
306#[repr(C)]
307pub struct CDslxCallGraph {
308    _private: [u8; 0], // Ensures the struct cannot be instantiated
309}
310
311#[repr(C)]
312pub struct CDslxQuickcheck {
313    _private: [u8; 0], // Ensures the struct cannot be instantiated
314}
315
316#[repr(C)]
317pub struct CDslxInvocationCalleeDataArray {
318    _private: [u8; 0],
319}
320
321#[repr(C)]
322pub struct CDslxInvocationCalleeData {
323    _private: [u8; 0],
324}
325
326#[repr(C)]
327pub struct CDslxInvocationData {
328    _private: [u8; 0],
329}
330
331#[repr(C)]
332pub struct CDslxInvocation {
333    _private: [u8; 0],
334}
335
336#[repr(C)]
337pub struct CScheduleAndCodegenResult {
338    _private: [u8; 0], // Ensures the struct cannot be instantiated
339}
340
341#[repr(C)]
342pub struct CIrBuilderBase {
343    _private: [u8; 0], // Ensures the struct cannot be instantiated
344}
345
346#[repr(C)]
347pub struct CIrBValue {
348    _private: [u8; 0], // Ensures the struct cannot be instantiated
349}
350
351#[repr(C)]
352pub struct CIrFunctionBuilder {
353    _private: [u8; 0], // Ensures the struct cannot be instantiated
354}
355
356pub type XlsFormatPreference = i32;
357pub type XlsValueKind = i32;
358
359// Calling convention used for DSLX mangling APIs.
360pub type XlsCallingConvention = i32;
361
362pub type CVastFileType = i32;
363
364pub type VastOperatorKind = i32;
365
366// Data kind for VAST Defs.
367pub type VastDataKind = i32;
368pub const XLS_VAST_DATA_KIND_REG: VastDataKind = 0;
369pub const XLS_VAST_DATA_KIND_WIRE: VastDataKind = 1;
370pub const XLS_VAST_DATA_KIND_LOGIC: VastDataKind = 2;
371pub const XLS_VAST_DATA_KIND_INTEGER: VastDataKind = 3;
372pub const XLS_VAST_DATA_KIND_INT: VastDataKind = 4;
373pub const XLS_VAST_DATA_KIND_USER: VastDataKind = 5;
374pub const XLS_VAST_DATA_KIND_UNTYPED_ENUM: VastDataKind = 6;
375pub const XLS_VAST_DATA_KIND_GENVAR: VastDataKind = 7;
376
377pub type DslxTypeDefinitionKind = i32;
378
379pub type DslxModuleMemberKind = i32;
380
381pub const XLS_CALLING_CONVENTION_TYPICAL: XlsCallingConvention = 0;
382pub const XLS_CALLING_CONVENTION_IMPLICIT_TOKEN: XlsCallingConvention = 1;
383pub const XLS_CALLING_CONVENTION_PROC_NEXT: XlsCallingConvention = 2;
384
385#[repr(C)]
386pub struct XlsDslxParametricEnvItem {
387    pub identifier: *const std::os::raw::c_char,
388    pub value: *const CDslxInterpValue,
389}
390
391#[repr(C)]
392pub struct XlsDslxFunctionSpecializationRequest {
393    pub function_name: *const std::os::raw::c_char,
394    pub specialized_name: *const std::os::raw::c_char,
395    pub env: *mut CDslxParametricEnv,
396}
397
398#[repr(C)]
399pub struct CDslxInvocationRewriteRule {
400    pub from_callee: *mut CDslxFunction,
401    pub to_callee: *mut CDslxFunction,
402    pub match_callee_env: *const CDslxParametricEnv,
403    pub to_callee_env: *const CDslxParametricEnv,
404}
405
406extern "C" {
407    pub fn xls_convert_dslx_to_ir(
408        dslx: *const std::os::raw::c_char,
409        path: *const std::os::raw::c_char,
410        module_name: *const std::os::raw::c_char,
411        dslx_stdlib_path: *const std::os::raw::c_char,
412        additional_search_paths: *const *const std::os::raw::c_char,
413        additional_search_paths_count: libc::size_t,
414        error_out: *mut *mut std::os::raw::c_char,
415        ir_out: *mut *mut std::os::raw::c_char,
416    ) -> bool;
417
418    pub fn xls_convert_dslx_to_ir_with_warnings(
419        dslx: *const std::os::raw::c_char,
420        path: *const std::os::raw::c_char,
421        module_name: *const std::os::raw::c_char,
422        dslx_stdlib_path: *const std::os::raw::c_char,
423        additional_search_paths: *const *const std::os::raw::c_char,
424        additional_search_paths_count: libc::size_t,
425        enable_warnings: *const *const std::os::raw::c_char,
426        enable_warnings_count: libc::size_t,
427        disable_warnings: *const *const std::os::raw::c_char,
428        disable_warnings_count: libc::size_t,
429        warnings_as_errors: bool,
430        force_implicit_token_calling_convention: bool,
431        warnings_out: *mut *mut *mut std::os::raw::c_char,
432        warnings_out_count: *mut libc::size_t,
433        error_out: *mut *mut std::os::raw::c_char,
434        ir_out: *mut *mut std::os::raw::c_char,
435    ) -> bool;
436
437    pub fn xls_convert_dslx_path_to_ir(
438        path: *const std::os::raw::c_char,
439        dslx_stdlib_path: *const std::os::raw::c_char,
440        additional_search_paths: *const *const std::os::raw::c_char,
441        additional_search_paths_count: libc::size_t,
442        error_out: *mut *mut std::os::raw::c_char,
443        ir_out: *mut *mut std::os::raw::c_char,
444    ) -> bool;
445
446    pub fn xls_convert_dslx_path_to_ir_with_warnings(
447        path: *const std::os::raw::c_char,
448        dslx_stdlib_path: *const std::os::raw::c_char,
449        additional_search_paths: *const *const std::os::raw::c_char,
450        additional_search_paths_count: libc::size_t,
451        enable_warnings: *const *const std::os::raw::c_char,
452        enable_warnings_count: libc::size_t,
453        disable_warnings: *const *const std::os::raw::c_char,
454        disable_warnings_count: libc::size_t,
455        warnings_as_errors: bool,
456        force_implicit_token_calling_convention: bool,
457        warnings_out: *mut *mut *mut std::os::raw::c_char,
458        warnings_out_count: *mut libc::size_t,
459        error_out: *mut *mut std::os::raw::c_char,
460        ir_out: *mut *mut std::os::raw::c_char,
461    ) -> bool;
462
463    pub fn xls_parse_typed_value(
464        text: *const std::os::raw::c_char,
465        error_out: *mut *mut std::os::raw::c_char,
466        value_out: *mut *mut CIrValue,
467    ) -> bool;
468    pub fn xls_value_free(value: *mut CIrValue);
469
470    pub fn xls_value_clone(value: *const CIrValue) -> *mut CIrValue;
471
472    // Extracts a bits value from a (boxed) value or gives an error.
473    pub fn xls_value_get_bits(
474        value: *const CIrValue,
475        error_out: *mut *mut std::os::raw::c_char,
476        bits_out: *mut *mut CIrBits,
477    ) -> bool;
478
479    // Turns a span of IR values into a tuple value.
480    pub fn xls_value_make_tuple(
481        value_count: libc::size_t,
482        values: *const *const CIrValue,
483    ) -> *mut CIrValue;
484
485    // Create a token value
486    pub fn xls_value_make_token() -> *mut CIrValue;
487
488    /// Returns an error:
489    /// * if the elements do not all have the same type, or
490    /// * if the array is empty (because then we cannot determine the element
491    ///   type)
492    pub fn xls_value_make_array(
493        element_count: libc::size_t,
494        elements: *const *const CIrValue,
495        error_out: *mut *mut std::os::raw::c_char,
496        result_out: *mut *mut CIrValue,
497    ) -> bool;
498
499    // Extracts an element from a tuple/array value or gives an error (e.g. if this
500    // value is not a tuple/array or the index is out of bounds).
501    pub fn xls_value_get_element(
502        tuple: *const CIrValue,
503        index: libc::size_t,
504        error_out: *mut *mut std::os::raw::c_char,
505        element_out: *mut *mut CIrValue,
506    ) -> bool;
507
508    pub fn xls_value_get_element_count(
509        value: *const CIrValue,
510        error_out: *mut *mut std::os::raw::c_char,
511        count_out: *mut i64,
512    ) -> bool;
513
514    // Creates a bits value (via an unsigned integer) that is boxed in an IrValue.
515    pub fn xls_value_make_ubits(
516        bit_count: i64,
517        value: u64,
518        error_out: *mut *mut std::os::raw::c_char,
519        result_out: *mut *mut CIrValue,
520    ) -> bool;
521
522    // Creates a bits value (via a signed integer) that is boxed in an IrValue.
523    pub fn xls_value_make_sbits(
524        bit_count: i64,
525        value: i64,
526        error_out: *mut *mut std::os::raw::c_char,
527        result_out: *mut *mut CIrValue,
528    ) -> bool;
529
530    // Boxes an IR bits object into an IR value.
531    pub fn xls_value_from_bits(bits: *const CIrBits) -> *mut CIrValue;
532
533    pub fn xls_bits_make_ubits(
534        bit_count: i64,
535        value: u64,
536        error_out: *mut *mut std::os::raw::c_char,
537        bits_out: *mut *mut CIrBits,
538    ) -> bool;
539
540    pub fn xls_bits_make_sbits(
541        bit_count: i64,
542        value: i64,
543        error_out: *mut *mut std::os::raw::c_char,
544        bits_out: *mut *mut CIrBits,
545    ) -> bool;
546
547    pub fn xls_bits_free(bits: *mut CIrBits);
548    pub fn xls_bits_get_bit_count(bits: *const CIrBits) -> i64;
549    pub fn xls_bits_get_bit(bits: *const CIrBits, index: i64) -> bool;
550    pub fn xls_bits_eq(bits: *const CIrBits, other: *const CIrBits) -> bool;
551    pub fn xls_bits_ne(a: *const CIrBits, b: *const CIrBits) -> bool;
552    pub fn xls_bits_ult(a: *const CIrBits, b: *const CIrBits) -> bool;
553    pub fn xls_bits_ule(a: *const CIrBits, b: *const CIrBits) -> bool;
554    pub fn xls_bits_ugt(a: *const CIrBits, b: *const CIrBits) -> bool;
555    pub fn xls_bits_uge(a: *const CIrBits, b: *const CIrBits) -> bool;
556    pub fn xls_bits_slt(a: *const CIrBits, b: *const CIrBits) -> bool;
557    pub fn xls_bits_sle(a: *const CIrBits, b: *const CIrBits) -> bool;
558    pub fn xls_bits_sgt(a: *const CIrBits, b: *const CIrBits) -> bool;
559    pub fn xls_bits_sge(a: *const CIrBits, b: *const CIrBits) -> bool;
560    pub fn xls_bits_to_debug_string(bits: *const CIrBits) -> *mut std::os::raw::c_char;
561    pub fn xls_bits_make_bits_from_bytes(
562        bit_count: libc::size_t,
563        bytes: *const u8,
564        byte_count: libc::size_t,
565        error_out: *mut *mut std::os::raw::c_char,
566        bits_out: *mut *mut CIrBits,
567    ) -> bool;
568    pub fn xls_mangle_dslx_name_full(
569        module_name: *const std::os::raw::c_char,
570        function_name: *const std::os::raw::c_char,
571        convention: XlsCallingConvention,
572        free_keys: *const *const std::os::raw::c_char,
573        free_keys_count: libc::size_t,
574        param_env: *const CDslxParametricEnv,
575        scope: *const std::os::raw::c_char,
576        error_out: *mut *mut std::os::raw::c_char,
577        mangled_out: *mut *mut std::os::raw::c_char,
578    ) -> bool;
579    pub fn xls_bits_add(lhs: *const CIrBits, rhs: *const CIrBits) -> *mut CIrBits;
580    pub fn xls_bits_sub(lhs: *const CIrBits, rhs: *const CIrBits) -> *mut CIrBits;
581    pub fn xls_bits_umul(lhs: *const CIrBits, rhs: *const CIrBits) -> *mut CIrBits;
582    pub fn xls_bits_smul(lhs: *const CIrBits, rhs: *const CIrBits) -> *mut CIrBits;
583    pub fn xls_bits_negate(bits: *const CIrBits) -> *mut CIrBits;
584    pub fn xls_bits_abs(bits: *const CIrBits) -> *mut CIrBits;
585    pub fn xls_bits_not(bits: *const CIrBits) -> *mut CIrBits;
586    pub fn xls_bits_and(lhs: *const CIrBits, rhs: *const CIrBits) -> *mut CIrBits;
587    pub fn xls_bits_or(lhs: *const CIrBits, rhs: *const CIrBits) -> *mut CIrBits;
588    pub fn xls_bits_xor(lhs: *const CIrBits, rhs: *const CIrBits) -> *mut CIrBits;
589
590    pub fn xls_bits_shift_left_logical(bits: *const CIrBits, shift_amount: i64) -> *mut CIrBits;
591    pub fn xls_bits_shift_right_logical(bits: *const CIrBits, shift_amount: i64) -> *mut CIrBits;
592    pub fn xls_bits_shift_right_arithmetic(bits: *const CIrBits, shift_amount: i64)
593        -> *mut CIrBits;
594
595    // struct xls_bits* xls_bits_width_slice(const struct xls_bits* bits, int64_t
596    // start, int64_t width);
597
598    pub fn xls_bits_width_slice(bits: *const CIrBits, start: i64, width: i64) -> *mut CIrBits;
599
600    pub fn xls_bits_to_bytes(
601        bits: *const CIrBits,
602        error_out: *mut *mut std::os::raw::c_char,
603        bytes_out: *mut *mut u8,
604        byte_count_out: *mut libc::size_t,
605    ) -> bool;
606    pub fn xls_bytes_free(bytes: *mut u8);
607    pub fn xls_bits_to_uint64(
608        bits: *const CIrBits,
609        error_out: *mut *mut std::os::raw::c_char,
610        value_out: *mut u64,
611    ) -> bool;
612    pub fn xls_bits_to_int64(
613        bits: *const CIrBits,
614        error_out: *mut *mut std::os::raw::c_char,
615        value_out: *mut i64,
616    ) -> bool;
617
618    pub fn xls_create_bits_rope(bit_count: i64) -> *mut CBitsRope;
619    pub fn xls_bits_rope_append_bits(bits_rope: *mut CBitsRope, bits: *const CIrBits);
620    pub fn xls_bits_rope_get_bits(bits_rope: *mut CBitsRope) -> *mut CIrBits;
621    pub fn xls_bits_rope_free(bits_rope: *mut CBitsRope);
622
623    pub fn xls_package_free(package: *mut CIrPackage);
624    pub fn xls_c_str_free(c_str: *mut std::os::raw::c_char);
625    pub fn xls_c_strs_free(c_strs: *mut *mut std::os::raw::c_char, count: libc::size_t);
626    pub fn xls_value_to_string(
627        value: *const CIrValue,
628        str_out: *mut *mut std::os::raw::c_char,
629    ) -> bool;
630    pub fn xls_format_preference_from_string(
631        s: *const std::os::raw::c_char,
632        error_out: *mut *mut std::os::raw::c_char,
633        result_out: *mut XlsFormatPreference,
634    ) -> bool;
635
636    pub fn xls_value_to_string_format_preference(
637        value: *const CIrValue,
638        fmt: XlsFormatPreference,
639        error_out: *mut *mut std::os::raw::c_char,
640        str_out: *mut *mut std::os::raw::c_char,
641    ) -> bool;
642    pub fn xls_bits_to_string(
643        bits: *const CIrBits,
644        fmt: XlsFormatPreference,
645        include_bit_count: bool,
646        error_out: *mut *mut std::os::raw::c_char,
647        str_out: *mut *mut std::os::raw::c_char,
648    ) -> bool;
649
650    pub fn xls_value_get_kind(
651        value: *const CIrValue,
652        error_out: *mut *mut std::os::raw::c_char,
653        kind_out: *mut XlsValueKind,
654    ) -> bool;
655    pub fn xls_value_make_true() -> *mut CIrValue;
656    pub fn xls_value_make_false() -> *mut CIrValue;
657    pub fn xls_value_from_bits_owned(bits: *mut CIrBits) -> *mut CIrValue;
658    pub fn xls_value_flatten_to_bits(value: *const CIrValue) -> *mut CIrBits;
659
660    pub fn xls_value_eq(value: *const CIrValue, value: *const CIrValue) -> bool;
661    pub fn xls_parse_ir_package(
662        ir: *const std::os::raw::c_char,
663        filename: *const std::os::raw::c_char,
664        error_out: *mut *mut std::os::raw::c_char,
665        xls_package_out: *mut *mut CIrPackage,
666    ) -> bool;
667    pub fn xls_type_to_string(
668        t: *const CIrType,
669        error_out: *mut *mut std::os::raw::c_char,
670        result_out: *mut *mut std::os::raw::c_char,
671    ) -> bool;
672    pub fn xls_type_get_kind(
673        t: *mut CIrType,
674        error_out: *mut *mut std::os::raw::c_char,
675        kind_out: *mut XlsValueKind,
676    ) -> bool;
677    pub fn xls_type_get_flat_bit_count(t: *const CIrType) -> i64;
678    pub fn xls_type_get_leaf_count(t: *mut CIrType) -> i64;
679    pub fn xls_package_get_type_for_value(
680        package: *const CIrPackage,
681        value: *const CIrValue,
682        error_out: *mut *mut std::os::raw::c_char,
683        result_out: *mut *mut CIrType,
684    ) -> bool;
685    pub fn xls_package_get_function(
686        package: *const CIrPackage,
687        function_name: *const std::os::raw::c_char,
688        error_out: *mut *mut std::os::raw::c_char,
689        result_out: *mut *mut CIrFunction,
690    ) -> bool;
691    pub fn xls_package_get_functions(
692        package: *mut CIrPackage,
693        error_out: *mut *mut std::os::raw::c_char,
694        result_out: *mut *mut *mut CIrFunction,
695        count_out: *mut libc::size_t,
696    ) -> bool;
697    pub fn xls_function_ptr_array_free(function_pointer_array: *mut *mut CIrFunction);
698    pub fn xls_function_get_type(
699        function: *const CIrFunction,
700        error_out: *mut *mut std::os::raw::c_char,
701        xls_fn_type_out: *mut *mut CIrFunctionType,
702    ) -> bool;
703    pub fn xls_function_type_to_string(
704        t: *const CIrFunctionType,
705        error_out: *mut *mut std::os::raw::c_char,
706        string_out: *mut *mut std::os::raw::c_char,
707    ) -> bool;
708    pub fn xls_function_get_name(
709        function: *const CIrFunction,
710        error_out: *mut *mut std::os::raw::c_char,
711        name_out: *mut *mut std::os::raw::c_char,
712    ) -> bool;
713    pub fn xls_function_to_z3_smtlib(
714        function: *mut CIrFunction,
715        error_out: *mut *mut std::os::raw::c_char,
716        string_out: *mut *mut std::os::raw::c_char,
717    ) -> bool;
718    pub fn xls_interpret_function(
719        function: *const CIrFunction,
720        argc: libc::size_t,
721        args: *const *const CIrValue,
722        error_out: *mut *mut std::os::raw::c_char,
723        result_out: *mut *mut CIrValue,
724    ) -> bool;
725    pub fn xls_optimize_ir(
726        ir: *const std::os::raw::c_char,
727        top: *const std::os::raw::c_char,
728        error_out: *mut *mut std::os::raw::c_char,
729        ir_out: *mut *mut std::os::raw::c_char,
730    ) -> bool;
731    pub fn xls_mangle_dslx_name(
732        module_name: *const std::os::raw::c_char,
733        function_name: *const std::os::raw::c_char,
734        error_out: *mut *mut std::os::raw::c_char,
735        mangled_out: *mut *mut std::os::raw::c_char,
736    ) -> bool;
737    pub fn xls_init_xls(
738        usage: *const std::os::raw::c_char,
739        argc: libc::c_int,
740        argv: *mut *mut std::os::raw::c_char,
741    );
742    pub fn xls_package_to_string(
743        p: *const CIrPackage,
744        string_out: *mut *mut std::os::raw::c_char,
745    ) -> bool;
746    pub fn xls_package_get_top(p: *mut CIrPackage) -> *mut CIrFunctionBase;
747    pub fn xls_package_set_top_by_name(
748        p: *mut CIrPackage,
749        name: *const std::os::raw::c_char,
750        error_out: *mut *mut std::os::raw::c_char,
751    ) -> bool;
752
753    pub fn xls_verify_package(
754        p: *mut CIrPackage,
755        error_out: *mut *mut std::os::raw::c_char,
756    ) -> bool;
757
758    pub fn xls_make_function_jit(
759        function: *const CIrFunction,
760        error_out: *mut *mut std::os::raw::c_char,
761        result_out: *mut *mut CIrFunctionJit,
762    ) -> bool;
763    pub fn xls_function_jit_free(jit: *mut CIrFunctionJit);
764    pub fn xls_function_jit_run(
765        jit: *const CIrFunctionJit,
766        argc: libc::size_t,
767        args: *const *const CIrValue,
768        error_out: *mut *mut std::os::raw::c_char,
769        trace_messages_out: *mut *mut CTraceMessage,
770        trace_messages_count_out: *mut libc::size_t,
771        assert_messages_out: *mut *mut *mut std::os::raw::c_char,
772        assert_messages_count_out: *mut libc::size_t,
773        result_out: *mut *mut CIrValue,
774    ) -> bool;
775    pub fn xls_trace_messages_free(trace_messages: *mut CTraceMessage, count: libc::size_t);
776
777    // -- VAST APIs
778
779    pub fn xls_vast_make_verilog_file(file_type: CVastFileType) -> *mut CVastFile;
780    pub fn xls_vast_verilog_file_free(f: *mut CVastFile);
781    pub fn xls_vast_verilog_file_add_module(
782        f: *mut CVastFile,
783        name: *const std::os::raw::c_char,
784    ) -> *mut CVastModule;
785
786    // - Node creation
787    pub fn xls_vast_verilog_file_make_scalar_type(f: *mut CVastFile) -> *mut CVastDataType;
788    pub fn xls_vast_verilog_file_make_bit_vector_type(
789        f: *mut CVastFile,
790        bit_count: i64,
791        is_signed: bool,
792    ) -> *mut CVastDataType;
793    pub fn xls_vast_verilog_file_make_bit_vector_type_expr(
794        f: *mut CVastFile,
795        width_expr: *mut CVastExpression,
796        is_signed: bool,
797    ) -> *mut CVastDataType;
798    pub fn xls_vast_verilog_file_make_integer_type(
799        f: *mut CVastFile,
800        is_signed: bool,
801    ) -> *mut CVastDataType;
802    pub fn xls_vast_verilog_file_make_int_type(
803        f: *mut CVastFile,
804        is_signed: bool,
805    ) -> *mut CVastDataType;
806    pub fn xls_vast_verilog_file_make_integer_def(
807        f: *mut CVastFile,
808        name: *const std::os::raw::c_char,
809        is_signed: bool,
810    ) -> *mut CVastDef;
811    pub fn xls_vast_verilog_file_make_int_def(
812        f: *mut CVastFile,
813        name: *const std::os::raw::c_char,
814        is_signed: bool,
815    ) -> *mut CVastDef;
816    pub fn xls_vast_verilog_file_make_extern_package_type(
817        f: *mut CVastFile,
818        package_name: *const std::os::raw::c_char,
819        type_name: *const std::os::raw::c_char,
820    ) -> *mut CVastDataType;
821    pub fn xls_vast_verilog_file_make_extern_type(
822        f: *mut CVastFile,
823        entity_name: *const std::os::raw::c_char,
824    ) -> *mut CVastDataType;
825    pub fn xls_vast_verilog_file_make_packed_array_type(
826        f: *mut CVastFile,
827        element_type: *mut CVastDataType,
828        dims: *const i64,
829        dim_count: libc::size_t,
830    ) -> *mut CVastDataType;
831
832    // -- Data type introspection
833    pub fn xls_vast_data_type_width_as_int64(
834        type_: *mut CVastDataType,
835        out_width: *mut i64,
836        error_out: *mut *mut std::os::raw::c_char,
837    ) -> bool;
838
839    pub fn xls_vast_data_type_flat_bit_count_as_int64(
840        type_: *mut CVastDataType,
841        out_flat_bit_count: *mut i64,
842        error_out: *mut *mut std::os::raw::c_char,
843    ) -> bool;
844
845    // Returns width expression; may return nullptr if none.
846    pub fn xls_vast_data_type_width(type_: *mut CVastDataType) -> *mut CVastExpression;
847
848    pub fn xls_vast_data_type_is_signed(type_: *mut CVastDataType) -> bool;
849
850    pub fn xls_vast_verilog_file_make_continuous_assignment(
851        f: *mut CVastFile,
852        lhs: *mut CVastExpression,
853        rhs: *mut CVastExpression,
854    ) -> *mut CVastContinuousAssignment;
855
856    pub fn xls_vast_verilog_file_make_concat(
857        f: *mut CVastFile,
858        expressions: *mut *mut CVastExpression,
859        expression_count: libc::size_t,
860    ) -> *mut CVastExpression;
861
862    pub fn xls_vast_verilog_file_make_replicated_concat(
863        f: *mut CVastFile,
864        replication: *mut CVastExpression,
865        elements: *mut *mut CVastExpression,
866        element_count: libc::size_t,
867    ) -> *mut CVastConcat;
868
869    pub fn xls_vast_verilog_file_make_replicated_concat_i64(
870        f: *mut CVastFile,
871        replication_count: i64,
872        elements: *mut *mut CVastExpression,
873        element_count: libc::size_t,
874    ) -> *mut CVastConcat;
875
876    pub fn xls_vast_verilog_file_make_slice_i64(
877        f: *mut CVastFile,
878        subject: *mut CVastIndexableExpression,
879        hi: i64,
880        lo: i64,
881    ) -> *mut CVastSlice;
882    pub fn xls_vast_verilog_file_make_slice(
883        f: *mut CVastFile,
884        subject: *mut CVastIndexableExpression,
885        hi: *mut CVastExpression,
886        lo: *mut CVastExpression,
887    ) -> *mut CVastSlice;
888
889    pub fn xls_vast_verilog_file_make_index(
890        f: *mut CVastFile,
891        subject: *mut CVastIndexableExpression,
892        index: *mut CVastExpression,
893    ) -> *mut CVastIndex;
894    pub fn xls_vast_verilog_file_make_index_i64(
895        f: *mut CVastFile,
896        subject: *mut CVastIndexableExpression,
897        index: i64,
898    ) -> *mut CVastIndex;
899
900    pub fn xls_vast_verilog_file_make_unary(
901        f: *mut CVastFile,
902        arg: *mut CVastExpression,
903        op: VastOperatorKind,
904    ) -> *mut CVastExpression;
905
906    pub fn xls_vast_verilog_file_make_binary(
907        f: *mut CVastFile,
908        lhs: *mut CVastExpression,
909        rhs: *mut CVastExpression,
910        op: VastOperatorKind,
911    ) -> *mut CVastExpression;
912
913    pub fn xls_vast_verilog_file_make_ternary(
914        f: *mut CVastFile,
915        cond: *mut CVastExpression,
916        then_expr: *mut CVastExpression,
917        else_expr: *mut CVastExpression,
918    ) -> *mut CVastExpression;
919
920    pub fn xls_vast_verilog_file_make_width_cast(
921        f: *mut CVastFile,
922        width: *mut CVastExpression,
923        value: *mut CVastExpression,
924    ) -> *mut CVastExpression;
925
926    // Cast a value to a specific type.
927    pub fn xls_vast_verilog_file_make_type_cast(
928        f: *mut CVastFile,
929        type_: *mut CVastDataType,
930        value: *mut CVastExpression,
931    ) -> *mut CVastExpression;
932
933    pub fn xls_vast_verilog_file_make_instantiation(
934        f: *mut CVastFile,
935        module_name: *const std::os::raw::c_char,
936        instance_name: *const std::os::raw::c_char,
937        parameter_port_names: *const *const std::os::raw::c_char,
938        parameter_expressions: *const *const CVastExpression,
939        parameter_count: libc::size_t,
940        connection_port_names: *const *const std::os::raw::c_char,
941        connection_expressions: *const *const CVastExpression,
942        connection_count: libc::size_t,
943    ) -> *mut CVastInstantiation;
944    pub fn xls_vast_verilog_file_make_comment(
945        f: *mut CVastFile,
946        text: *const std::os::raw::c_char,
947    ) -> *mut CVastComment;
948    pub fn xls_vast_verilog_file_make_blank_line(f: *mut CVastFile) -> *mut CVastBlankLine;
949    pub fn xls_vast_verilog_file_make_inline_verilog_statement(
950        f: *mut CVastFile,
951        text: *const std::os::raw::c_char,
952    ) -> *mut CVastInlineVerilogStatement;
953    pub fn xls_vast_verilog_file_make_literal(
954        f: *mut CVastFile,
955        bits: *const CIrBits,
956        format_preference: XlsFormatPreference,
957        emit_bit_count: bool,
958        error_out: *mut *mut std::os::raw::c_char,
959        literal_out: *mut *mut CVastLiteral,
960    ) -> bool;
961    pub fn xls_vast_verilog_file_make_plain_literal(
962        f: *mut CVastFile,
963        value: i32,
964    ) -> *mut CVastLiteral;
965
966    // - Module additions
967    pub fn xls_vast_verilog_module_add_parameter_port(
968        m: *mut CVastModule,
969        name: *const std::os::raw::c_char,
970        rhs: *mut CVastExpression,
971    ) -> *mut CVastLogicRef;
972    pub fn xls_vast_verilog_module_add_typed_parameter_port(
973        m: *mut CVastModule,
974        name: *const std::os::raw::c_char,
975        type_: *mut CVastDataType,
976        rhs: *mut CVastExpression,
977    ) -> *mut CVastLogicRef;
978    pub fn xls_vast_verilog_module_add_input(
979        m: *mut CVastModule,
980        name: *const std::os::raw::c_char,
981        type_: *mut CVastDataType,
982    ) -> *mut CVastLogicRef;
983    pub fn xls_vast_verilog_module_add_output(
984        m: *mut CVastModule,
985        name: *const std::os::raw::c_char,
986        type_: *mut CVastDataType,
987    ) -> *mut CVastLogicRef;
988    pub fn xls_vast_verilog_module_add_inout(
989        m: *mut CVastModule,
990        name: *const std::os::raw::c_char,
991        type_: *mut CVastDataType,
992    ) -> *mut CVastLogicRef;
993    pub fn xls_vast_verilog_module_add_logic_input(
994        m: *mut CVastModule,
995        name: *const std::os::raw::c_char,
996        type_: *mut CVastDataType,
997    ) -> *mut CVastLogicRef;
998    pub fn xls_vast_verilog_module_add_logic_output(
999        m: *mut CVastModule,
1000        name: *const std::os::raw::c_char,
1001        type_: *mut CVastDataType,
1002    ) -> *mut CVastLogicRef;
1003    pub fn xls_vast_verilog_module_add_wire(
1004        m: *mut CVastModule,
1005        name: *const std::os::raw::c_char,
1006        type_: *mut CVastDataType,
1007    ) -> *mut CVastLogicRef;
1008    pub fn xls_vast_verilog_module_add_generate_loop(
1009        m: *mut CVastModule,
1010        genvar_name: *const std::os::raw::c_char,
1011        init: *mut CVastExpression,
1012        limit: *mut CVastExpression,
1013        label: *const std::os::raw::c_char,
1014    ) -> *mut CVastGenerateLoop;
1015    pub fn xls_vast_verilog_module_add_member_instantiation(
1016        m: *mut CVastModule,
1017        inst: *mut CVastInstantiation,
1018    );
1019    pub fn xls_vast_verilog_module_add_member_continuous_assignment(
1020        m: *mut CVastModule,
1021        ca: *mut CVastContinuousAssignment,
1022    );
1023    pub fn xls_vast_verilog_module_add_member_comment(
1024        m: *mut CVastModule,
1025        comment: *mut CVastComment,
1026    );
1027    pub fn xls_vast_verilog_module_add_member_blank_line(
1028        m: *mut CVastModule,
1029        blank: *mut CVastBlankLine,
1030    );
1031    pub fn xls_vast_verilog_module_add_member_inline_statement(
1032        m: *mut CVastModule,
1033        stmt: *mut CVastInlineVerilogStatement,
1034    );
1035    pub fn xls_vast_verilog_module_add_member_macro_statement(
1036        m: *mut CVastModule,
1037        statement: *mut CVastMacroStatement,
1038    );
1039
1040    pub fn xls_vast_verilog_module_add_parameter(
1041        m: *mut CVastModule,
1042        name: *const std::os::raw::c_char,
1043        rhs: *mut CVastExpression,
1044    ) -> *mut CVastParameterRef;
1045
1046    pub fn xls_vast_verilog_module_add_localparam(
1047        m: *mut CVastModule,
1048        name: *const std::os::raw::c_char,
1049        rhs: *mut CVastExpression,
1050    ) -> *mut CVastLocalparamRef;
1051
1052    pub fn xls_vast_verilog_file_make_def(
1053        f: *mut CVastFile,
1054        name: *const std::os::raw::c_char,
1055        kind: VastDataKind,
1056        type_: *mut CVastDataType,
1057    ) -> *mut CVastDef;
1058
1059    pub fn xls_vast_verilog_module_add_parameter_with_def(
1060        m: *mut CVastModule,
1061        def: *mut CVastDef,
1062        rhs: *mut CVastExpression,
1063    ) -> *mut CVastParameterRef;
1064
1065    pub fn xls_vast_verilog_module_add_localparam_with_def(
1066        m: *mut CVastModule,
1067        def: *mut CVastDef,
1068        rhs: *mut CVastExpression,
1069    ) -> *mut CVastLocalparamRef;
1070
1071    pub fn xls_vast_verilog_module_get_name(m: *mut CVastModule) -> *mut std::os::raw::c_char;
1072
1073    // - Expression conversions
1074    pub fn xls_vast_logic_ref_as_indexable_expression(
1075        v: *mut CVastLogicRef,
1076    ) -> *mut CVastIndexableExpression;
1077    pub fn xls_vast_index_as_indexable_expression(
1078        v: *mut CVastIndex,
1079    ) -> *mut CVastIndexableExpression;
1080
1081    pub fn xls_vast_literal_as_expression(v: *mut CVastLiteral) -> *mut CVastExpression;
1082    pub fn xls_vast_concat_as_expression(v: *mut CVastConcat) -> *mut CVastExpression;
1083    pub fn xls_vast_logic_ref_as_expression(v: *mut CVastLogicRef) -> *mut CVastExpression;
1084    pub fn xls_vast_slice_as_expression(v: *mut CVastSlice) -> *mut CVastExpression;
1085    pub fn xls_vast_index_as_expression(v: *mut CVastIndex) -> *mut CVastExpression;
1086    pub fn xls_vast_parameter_ref_as_expression(v: *mut CVastParameterRef) -> *mut CVastExpression;
1087    pub fn xls_vast_localparam_ref_as_expression(
1088        v: *mut CVastLocalparamRef,
1089    ) -> *mut CVastExpression;
1090    pub fn xls_vast_indexable_expression_as_expression(
1091        v: *mut CVastIndexableExpression,
1092    ) -> *mut CVastExpression;
1093    pub fn xls_vast_macro_ref_as_expression(v: *mut CVastMacroRef) -> *mut CVastExpression;
1094    pub fn xls_vast_verilog_file_make_unsized_one_literal(
1095        f: *mut CVastFile,
1096    ) -> *mut CVastExpression;
1097    pub fn xls_vast_verilog_file_make_unsized_zero_literal(
1098        f: *mut CVastFile,
1099    ) -> *mut CVastExpression;
1100    pub fn xls_vast_verilog_file_make_unsized_x_literal(f: *mut CVastFile) -> *mut CVastExpression;
1101    pub fn xls_vast_verilog_file_make_macro_ref(
1102        f: *mut CVastFile,
1103        name: *const std::os::raw::c_char,
1104    ) -> *mut CVastMacroRef;
1105    pub fn xls_vast_verilog_file_make_macro_ref_with_args(
1106        f: *mut CVastFile,
1107        name: *const std::os::raw::c_char,
1108        args: *mut *mut CVastExpression,
1109        arg_count: libc::size_t,
1110    ) -> *mut CVastMacroRef;
1111    pub fn xls_vast_verilog_file_make_macro_statement(
1112        f: *mut CVastFile,
1113        r#ref: *mut CVastMacroRef,
1114    ) -> *mut CVastMacroStatement;
1115
1116    pub fn xls_vast_logic_ref_get_name(v: *mut CVastLogicRef) -> *mut std::os::raw::c_char;
1117
1118    pub fn xls_vast_verilog_file_add_include(f: *mut CVastFile, path: *const std::os::raw::c_char);
1119    pub fn xls_vast_verilog_file_emit(f: *const CVastFile) -> *mut std::os::raw::c_char;
1120
1121    // -- DSLX
1122
1123    pub fn xls_dslx_import_data_create(
1124        dslx_stdlib_path: *const std::os::raw::c_char,
1125        additional_search_paths: *const *const std::os::raw::c_char,
1126        additional_search_paths_count: libc::size_t,
1127    ) -> *mut CDslxImportData;
1128    pub fn xls_dslx_import_data_free(data: *mut CDslxImportData);
1129
1130    pub fn xls_dslx_parse_and_typecheck(
1131        text: *const std::os::raw::c_char,
1132        path: *const std::os::raw::c_char,
1133        module_name: *const std::os::raw::c_char,
1134        import_data: *const CDslxImportData,
1135        error_out: *mut *mut std::os::raw::c_char,
1136        typechecked_module_out: *mut *mut CDslxTypecheckedModule,
1137    ) -> bool;
1138
1139    pub fn xls_dslx_typechecked_module_clone_removing_functions(
1140        tm: *mut CDslxTypecheckedModule,
1141        functions: *mut *mut CDslxFunction,
1142        function_count: libc::size_t,
1143        install_subject: *const std::os::raw::c_char,
1144        import_data: *mut CDslxImportData,
1145        error_out: *mut *mut std::os::raw::c_char,
1146        result_out: *mut *mut CDslxTypecheckedModule,
1147    ) -> bool;
1148
1149    pub fn xls_dslx_replace_invocations_in_module(
1150        tm: *mut CDslxTypecheckedModule,
1151        callers: *const *mut CDslxFunction,
1152        callers_count: libc::size_t,
1153        rules: *const CDslxInvocationRewriteRule,
1154        rules_count: libc::size_t,
1155        import_data: *mut CDslxImportData,
1156        install_subject: *const std::os::raw::c_char,
1157        error_out: *mut *mut std::os::raw::c_char,
1158        result_out: *mut *mut CDslxTypecheckedModule,
1159    ) -> bool;
1160
1161    pub fn xls_dslx_typechecked_module_insert_function_specializations(
1162        typechecked_module: *mut CDslxTypecheckedModule,
1163        requests: *const XlsDslxFunctionSpecializationRequest,
1164        request_count: libc::size_t,
1165        import_data: *mut CDslxImportData,
1166        install_subject: *const std::os::raw::c_char,
1167        error_out: *mut *mut std::os::raw::c_char,
1168        result_out: *mut *mut CDslxTypecheckedModule,
1169    ) -> bool;
1170
1171    // bool xls_schedule_and_codegen_package(
1172    // struct xls_package* p, const char* scheduling_options_flags_proto,
1173    // const char* codegen_flags_proto, bool with_delay_model, char** error_out,
1174    // struct xls_schedule_and_codegen_result** result_out);
1175    pub fn xls_schedule_and_codegen_package(
1176        p: *mut CIrPackage,
1177        scheduling_options_flags_proto: *const std::os::raw::c_char,
1178        codegen_flags_proto: *const std::os::raw::c_char,
1179        with_delay_model: bool,
1180        error_out: *mut *mut std::os::raw::c_char,
1181        result_out: *mut *mut CScheduleAndCodegenResult,
1182    ) -> bool;
1183
1184    pub fn xls_schedule_and_codegen_result_get_verilog_text(
1185        result: *mut CScheduleAndCodegenResult,
1186    ) -> *mut std::os::raw::c_char;
1187
1188    pub fn xls_schedule_and_codegen_result_free(result: *mut CScheduleAndCodegenResult);
1189
1190    pub fn xls_dslx_typechecked_module_free(module: *mut CDslxTypecheckedModule);
1191
1192    pub fn xls_dslx_typechecked_module_get_module(
1193        module: *mut CDslxTypecheckedModule,
1194    ) -> *mut CDslxModule;
1195
1196    pub fn xls_dslx_typechecked_module_get_type_info(
1197        module: *mut CDslxTypecheckedModule,
1198    ) -> *mut CDslxTypeInfo;
1199
1200    pub fn xls_dslx_module_to_string(module: *mut CDslxModule) -> *mut std::os::raw::c_char;
1201
1202    pub fn xls_dslx_module_get_name(module: *const CDslxModule) -> *mut std::os::raw::c_char;
1203
1204    pub fn xls_dslx_module_get_type_definition_count(module: *const CDslxModule) -> i64;
1205
1206    pub fn xls_dslx_module_get_member_count(module: *const CDslxModule) -> i64;
1207
1208    pub fn xls_dslx_module_get_member(module: *const CDslxModule, i: i64)
1209        -> *mut CDslxModuleMember;
1210
1211    pub fn xls_dslx_module_get_type_definition_kind(
1212        module: *const CDslxModule,
1213        i: i64,
1214    ) -> DslxTypeDefinitionKind;
1215
1216    pub fn xls_dslx_module_get_type_definition_as_struct_def(
1217        module: *const CDslxModule,
1218        i: i64,
1219    ) -> *mut CDslxStructDef;
1220    pub fn xls_dslx_module_get_type_definition_as_enum_def(
1221        module: *const CDslxModule,
1222        i: i64,
1223    ) -> *mut CDslxEnumDef;
1224    pub fn xls_dslx_module_get_type_definition_as_type_alias(
1225        module: *const CDslxModule,
1226        i: i64,
1227    ) -> *mut CDslxTypeAlias;
1228
1229    // -- xls_dslx_module_member
1230    pub fn xls_dslx_module_member_get_kind(
1231        member: *const CDslxModuleMember,
1232    ) -> DslxModuleMemberKind;
1233    pub fn xls_dslx_module_member_get_constant_def(
1234        member: *const CDslxModuleMember,
1235    ) -> *mut CDslxConstantDef;
1236    pub fn xls_dslx_module_member_get_type_alias(
1237        member: *const CDslxModuleMember,
1238    ) -> *mut CDslxTypeAlias;
1239    pub fn xls_dslx_module_member_get_struct_def(
1240        member: *const CDslxModuleMember,
1241    ) -> *mut CDslxStructDef;
1242    pub fn xls_dslx_module_member_get_enum_def(
1243        member: *const CDslxModuleMember,
1244    ) -> *mut CDslxEnumDef;
1245
1246    pub fn xls_dslx_colon_ref_get_attr(
1247        colon_ref: *const CDslxColonRef,
1248    ) -> *mut std::os::raw::c_char;
1249
1250    pub fn xls_dslx_type_info_get_type_struct_def(
1251        type_info: *mut CDslxTypeInfo,
1252        node: *mut CDslxStructDef,
1253    ) -> *mut CDslxType;
1254    pub fn xls_dslx_type_info_get_type_enum_def(
1255        type_info: *mut CDslxTypeInfo,
1256        node: *mut CDslxEnumDef,
1257    ) -> *mut CDslxType;
1258    pub fn xls_dslx_type_info_get_type_struct_member(
1259        type_info: *mut CDslxTypeInfo,
1260        member: *mut CDslxStructMember,
1261    ) -> *mut CDslxType;
1262    pub fn xls_dslx_type_info_get_type_type_alias(
1263        type_info: *mut CDslxTypeInfo,
1264        node: *mut CDslxTypeAlias,
1265    ) -> *mut CDslxType;
1266    pub fn xls_dslx_type_info_get_type_constant_def(
1267        type_info: *mut CDslxTypeInfo,
1268        node: *mut CDslxConstantDef,
1269    ) -> *mut CDslxType;
1270
1271    /// Gets the concrete type for a TypeAnnotation AST node.
1272    pub fn xls_dslx_type_info_get_type_type_annotation(
1273        type_info: *mut CDslxTypeInfo,
1274        type_annotation: *mut CDslxTypeAnnotation,
1275    ) -> *mut CDslxType;
1276
1277    pub fn xls_dslx_type_info_get_imported_type_info(
1278        type_info: *mut CDslxTypeInfo,
1279        module: *mut CDslxModule,
1280    ) -> *mut CDslxTypeInfo;
1281
1282    pub fn xls_dslx_type_info_get_unique_invocation_callee_data(
1283        type_info: *mut CDslxTypeInfo,
1284        function: *mut CDslxFunction,
1285    ) -> *mut CDslxInvocationCalleeDataArray;
1286    pub fn xls_dslx_type_info_get_all_invocation_callee_data(
1287        type_info: *mut CDslxTypeInfo,
1288        function: *mut CDslxFunction,
1289    ) -> *mut CDslxInvocationCalleeDataArray;
1290    pub fn xls_dslx_type_info_get_root_invocation_data(
1291        type_info: *mut CDslxTypeInfo,
1292        invocation: *mut CDslxInvocation,
1293    ) -> *mut CDslxInvocationData;
1294
1295    // -- call_graph
1296    pub fn xls_dslx_type_info_build_function_call_graph(
1297        type_info: *mut CDslxTypeInfo,
1298        error_out: *mut *mut std::os::raw::c_char,
1299        result_out: *mut *mut CDslxCallGraph,
1300    ) -> bool;
1301
1302    pub fn xls_dslx_call_graph_free(call_graph: *mut CDslxCallGraph);
1303
1304    pub fn xls_dslx_call_graph_get_function_count(call_graph: *mut CDslxCallGraph) -> i64;
1305
1306    pub fn xls_dslx_call_graph_get_function(
1307        call_graph: *mut CDslxCallGraph,
1308        index: i64,
1309    ) -> *mut CDslxFunction;
1310
1311    pub fn xls_dslx_call_graph_get_callee_count(
1312        call_graph: *mut CDslxCallGraph,
1313        caller: *mut CDslxFunction,
1314    ) -> i64;
1315
1316    pub fn xls_dslx_call_graph_get_callee_function(
1317        call_graph: *mut CDslxCallGraph,
1318        caller: *mut CDslxFunction,
1319        callee_index: i64,
1320    ) -> *mut CDslxFunction;
1321
1322    pub fn xls_dslx_invocation_callee_data_array_free(array: *mut CDslxInvocationCalleeDataArray);
1323    pub fn xls_dslx_invocation_callee_data_array_get_count(
1324        array: *mut CDslxInvocationCalleeDataArray,
1325    ) -> i64;
1326    pub fn xls_dslx_invocation_callee_data_array_get(
1327        array: *mut CDslxInvocationCalleeDataArray,
1328        index: i64,
1329    ) -> *mut CDslxInvocationCalleeData;
1330
1331    pub fn xls_dslx_invocation_callee_data_clone(
1332        data: *mut CDslxInvocationCalleeData,
1333    ) -> *mut CDslxInvocationCalleeData;
1334    pub fn xls_dslx_invocation_callee_data_free(data: *mut CDslxInvocationCalleeData);
1335    pub fn xls_dslx_invocation_callee_data_get_callee_bindings(
1336        data: *mut CDslxInvocationCalleeData,
1337    ) -> *const CDslxParametricEnv;
1338    pub fn xls_dslx_invocation_callee_data_get_caller_bindings(
1339        data: *mut CDslxInvocationCalleeData,
1340    ) -> *const CDslxParametricEnv;
1341    pub fn xls_dslx_invocation_callee_data_get_derived_type_info(
1342        data: *mut CDslxInvocationCalleeData,
1343    ) -> *mut CDslxTypeInfo;
1344    pub fn xls_dslx_invocation_callee_data_get_invocation(
1345        data: *mut CDslxInvocationCalleeData,
1346    ) -> *mut CDslxInvocation;
1347
1348    pub fn xls_dslx_invocation_data_get_invocation(
1349        data: *mut CDslxInvocationData,
1350    ) -> *mut CDslxInvocation;
1351    pub fn xls_dslx_invocation_data_get_callee(
1352        data: *mut CDslxInvocationData,
1353    ) -> *mut CDslxFunction;
1354    pub fn xls_dslx_invocation_data_get_caller(
1355        data: *mut CDslxInvocationData,
1356    ) -> *mut CDslxFunction;
1357
1358    // -- ConstantDef
1359
1360    pub fn xls_dslx_constant_def_get_name(
1361        constant_def: *const CDslxConstantDef,
1362    ) -> *mut std::os::raw::c_char;
1363
1364    pub fn xls_dslx_constant_def_get_value(constant_def: *const CDslxConstantDef)
1365        -> *mut CDslxExpr;
1366
1367    // -- TypeAlias
1368
1369    pub fn xls_dslx_type_alias_get_identifier(
1370        type_alias: *const CDslxTypeAlias,
1371    ) -> *mut std::os::raw::c_char;
1372
1373    pub fn xls_dslx_type_alias_get_type_annotation(
1374        type_alias: *const CDslxTypeAlias,
1375    ) -> *mut CDslxTypeAnnotation;
1376
1377    // -- TypeAnnotation
1378
1379    pub fn xls_dslx_type_annotation_get_type_ref_type_annotation(
1380        type_annotation: *const CDslxTypeAnnotation,
1381    ) -> *mut CDslxTypeRefTypeAnnotation;
1382
1383    // -- TypeRef
1384
1385    pub fn xls_dslx_type_ref_get_type_definition(
1386        type_ref: *const CDslxTypeRef,
1387    ) -> *mut CDslxTypeDefinition;
1388
1389    // -- Import
1390
1391    pub fn xls_dslx_import_get_subject_count(import: *const CDslxImport) -> i64;
1392    pub fn xls_dslx_import_get_subject(
1393        import: *const CDslxImport,
1394        i: i64,
1395    ) -> *mut std::os::raw::c_char;
1396
1397    // -- ColonRef
1398
1399    pub fn xls_dslx_colon_ref_resolve_import_subject(
1400        colon_ref: *const CDslxColonRef,
1401    ) -> *mut CDslxImport;
1402
1403    // -- TypeDefinition
1404
1405    pub fn xls_dslx_type_definition_get_colon_ref(
1406        type_definition: *const CDslxTypeDefinition,
1407    ) -> *mut CDslxColonRef;
1408    pub fn xls_dslx_type_definition_get_type_alias(
1409        type_definition: *const CDslxTypeDefinition,
1410    ) -> *mut CDslxTypeAlias;
1411
1412    // -- TypeRefTypeAnnotation
1413
1414    pub fn xls_dslx_type_ref_type_annotation_get_type_ref(
1415        type_ref_type_annotation: *const CDslxTypeRefTypeAnnotation,
1416    ) -> *mut CDslxTypeRef;
1417
1418    // -- StructDef
1419
1420    pub fn xls_dslx_struct_def_get_identifier(
1421        struct_def: *const CDslxStructDef,
1422    ) -> *mut std::os::raw::c_char;
1423
1424    pub fn xls_dslx_struct_def_is_parametric(struct_def: *const CDslxStructDef) -> bool;
1425
1426    pub fn xls_dslx_struct_def_get_member_count(struct_def: *const CDslxStructDef) -> i64;
1427
1428    pub fn xls_dslx_struct_def_get_member(
1429        struct_def: *const CDslxStructDef,
1430        i: i64,
1431    ) -> *mut CDslxStructMember;
1432
1433    pub fn xls_dslx_struct_member_get_name(
1434        member: *const CDslxStructMember,
1435    ) -> *mut std::os::raw::c_char;
1436
1437    pub fn xls_dslx_struct_member_get_type(
1438        member: *const CDslxStructMember,
1439    ) -> *mut CDslxTypeAnnotation;
1440
1441    // -- EnumDef
1442
1443    pub fn xls_dslx_enum_def_get_identifier(
1444        enum_def: *const CDslxEnumDef,
1445    ) -> *mut std::os::raw::c_char;
1446
1447    pub fn xls_dslx_enum_def_get_member_count(enum_def: *const CDslxEnumDef) -> i64;
1448
1449    pub fn xls_dslx_enum_def_get_member(
1450        enum_def: *const CDslxEnumDef,
1451        i: i64,
1452    ) -> *mut CDslxEnumMember;
1453
1454    pub fn xls_dslx_enum_def_get_underlying(
1455        enum_def: *const CDslxEnumDef,
1456    ) -> *mut CDslxTypeAnnotation;
1457
1458    pub fn xls_dslx_enum_member_get_name(
1459        member: *const CDslxEnumMember,
1460    ) -> *mut std::os::raw::c_char;
1461
1462    pub fn xls_dslx_enum_member_get_value(member: *const CDslxEnumMember) -> *mut CDslxExpr;
1463
1464    pub fn xls_dslx_expr_get_owner_module(expr: *mut CDslxExpr) -> *mut CDslxModule;
1465
1466    // --
1467
1468    pub fn xls_dslx_interp_value_free(value: *mut CDslxInterpValue);
1469
1470    pub fn xls_dslx_interp_value_to_string(
1471        value: *mut CDslxInterpValue,
1472    ) -> *mut std::os::raw::c_char;
1473
1474    pub fn xls_dslx_interp_value_clone(value: *const CDslxInterpValue) -> *mut CDslxInterpValue;
1475
1476    // Parametric env construction and InterpValue helpers
1477    pub fn xls_dslx_parametric_env_create(
1478        items: *const XlsDslxParametricEnvItem,
1479        items_count: libc::size_t,
1480        error_out: *mut *mut std::os::raw::c_char,
1481        env_out: *mut *mut CDslxParametricEnv,
1482    ) -> bool;
1483    pub fn xls_dslx_parametric_env_free(env: *mut CDslxParametricEnv);
1484    pub fn xls_dslx_parametric_env_clone(env: *const CDslxParametricEnv)
1485        -> *mut CDslxParametricEnv;
1486    pub fn xls_dslx_parametric_env_equals(
1487        lhs: *const CDslxParametricEnv,
1488        rhs: *const CDslxParametricEnv,
1489    ) -> bool;
1490    pub fn xls_dslx_parametric_env_less_than(
1491        lhs: *const CDslxParametricEnv,
1492        rhs: *const CDslxParametricEnv,
1493    ) -> bool;
1494    pub fn xls_dslx_parametric_env_hash(env: *const CDslxParametricEnv) -> u64;
1495    pub fn xls_dslx_parametric_env_to_string(
1496        env: *const CDslxParametricEnv,
1497    ) -> *mut std::os::raw::c_char;
1498    pub fn xls_dslx_parametric_env_get_binding_count(env: *const CDslxParametricEnv) -> i64;
1499    pub fn xls_dslx_parametric_env_get_binding_identifier(
1500        env: *const CDslxParametricEnv,
1501        index: i64,
1502    ) -> *const std::os::raw::c_char;
1503    pub fn xls_dslx_parametric_env_get_binding_value(
1504        env: *const CDslxParametricEnv,
1505        index: i64,
1506    ) -> *mut CDslxInterpValue;
1507
1508    pub fn xls_dslx_interp_value_make_ubits(bit_count: i64, value: u64) -> *mut CDslxInterpValue;
1509    pub fn xls_dslx_interp_value_make_sbits(bit_count: i64, value: i64) -> *mut CDslxInterpValue;
1510    pub fn xls_dslx_interp_value_make_enum(
1511        def: *mut CDslxEnumDef,
1512        is_signed: bool,
1513        bits: *const CIrBits,
1514        error_out: *mut *mut std::os::raw::c_char,
1515        result_out: *mut *mut CDslxInterpValue,
1516    ) -> bool;
1517    pub fn xls_dslx_interp_value_make_tuple(
1518        element_count: libc::size_t,
1519        elements: *mut *mut CDslxInterpValue,
1520        error_out: *mut *mut std::os::raw::c_char,
1521        result_out: *mut *mut CDslxInterpValue,
1522    ) -> bool;
1523    pub fn xls_dslx_interp_value_make_array(
1524        element_count: libc::size_t,
1525        elements: *mut *mut CDslxInterpValue,
1526        error_out: *mut *mut std::os::raw::c_char,
1527        result_out: *mut *mut CDslxInterpValue,
1528    ) -> bool;
1529
1530    pub fn xls_dslx_interp_value_from_string(
1531        text: *const std::os::raw::c_char,
1532        dslx_stdlib_path: *const std::os::raw::c_char,
1533        error_out: *mut *mut std::os::raw::c_char,
1534        result_out: *mut *mut CDslxInterpValue,
1535    ) -> bool;
1536
1537    pub fn xls_dslx_interp_value_convert_to_ir(
1538        value: *const CDslxInterpValue,
1539        error_out: *mut *mut std::os::raw::c_char,
1540        result_out: *mut *mut CIrValue,
1541    ) -> bool;
1542
1543    pub fn xls_dslx_type_to_string(
1544        type_: *const CDslxType,
1545        error_out: *mut *mut std::os::raw::c_char,
1546        result_out: *mut *mut std::os::raw::c_char,
1547    ) -> bool;
1548
1549    // Stringification for DSLX AST nodes
1550    pub fn xls_dslx_function_to_string(function: *const CDslxFunction)
1551        -> *mut std::os::raw::c_char;
1552    pub fn xls_dslx_struct_def_to_string(
1553        struct_def: *const CDslxStructDef,
1554    ) -> *mut std::os::raw::c_char;
1555    pub fn xls_dslx_enum_def_to_string(enum_def: *const CDslxEnumDef) -> *mut std::os::raw::c_char;
1556    pub fn xls_dslx_type_alias_to_string(
1557        type_alias: *const CDslxTypeAlias,
1558    ) -> *mut std::os::raw::c_char;
1559    pub fn xls_dslx_constant_def_to_string(
1560        constant_def: *const CDslxConstantDef,
1561    ) -> *mut std::os::raw::c_char;
1562    pub fn xls_dslx_quickcheck_to_string(qc: *const CDslxQuickcheck) -> *mut std::os::raw::c_char;
1563
1564    pub fn xls_dslx_type_info_get_const_expr(
1565        type_info: *mut CDslxTypeInfo,
1566        expr: *mut CDslxExpr,
1567        error_out: *mut *mut std::os::raw::c_char,
1568        result_out: *mut *mut CDslxInterpValue,
1569    ) -> bool;
1570
1571    pub fn xls_dslx_type_get_total_bit_count(
1572        type_: *const CDslxType,
1573        error_out: *mut *mut std::os::raw::c_char,
1574        result_out: *mut i64,
1575    ) -> bool;
1576
1577    pub fn xls_dslx_type_is_signed_bits(
1578        type_: *const CDslxType,
1579        error_out: *mut *mut std::os::raw::c_char,
1580        result_out: *mut bool,
1581    ) -> bool;
1582
1583    pub fn xls_dslx_type_is_bits_like(
1584        type_: *const CDslxType,
1585        is_signed: *mut *mut CDslxTypeDim,
1586        size: *mut *mut CDslxTypeDim,
1587    ) -> bool;
1588
1589    pub fn xls_dslx_type_is_enum(type_: *const CDslxType) -> bool;
1590    pub fn xls_dslx_type_is_struct(type_: *const CDslxType) -> bool;
1591    pub fn xls_dslx_type_is_array(type_: *const CDslxType) -> bool;
1592
1593    pub fn xls_dslx_type_dim_is_parametric(dim: *const CDslxTypeDim) -> bool;
1594    pub fn xls_dslx_type_dim_get_as_bool(
1595        dim: *const CDslxTypeDim,
1596        error_out: *mut *mut std::os::raw::c_char,
1597        result_out: *mut bool,
1598    ) -> bool;
1599    pub fn xls_dslx_type_dim_get_as_int64(
1600        dim: *const CDslxTypeDim,
1601        error_out: *mut *mut std::os::raw::c_char,
1602        result_out: *mut i64,
1603    ) -> bool;
1604    pub fn xls_dslx_type_dim_free(dim: *mut CDslxTypeDim);
1605
1606    pub fn xls_dslx_type_get_enum_def(ty: *const CDslxType) -> *mut CDslxEnumDef;
1607
1608    pub fn xls_dslx_type_get_struct_def(ty: *const CDslxType) -> *mut CDslxStructDef;
1609
1610    pub fn xls_dslx_type_array_get_element_type(ty: *const CDslxType) -> *mut CDslxType;
1611    pub fn xls_dslx_type_array_get_size(ty: *const CDslxType) -> *mut CDslxTypeDim;
1612
1613    // -- IR builder APIs
1614
1615    pub fn xls_package_create(name: *const std::os::raw::c_char) -> *mut CIrPackage;
1616    pub fn xls_package_get_bits_type(package: *mut CIrPackage, bit_count: i64) -> *mut CIrType;
1617
1618    pub fn xls_package_get_tuple_type(
1619        package: *mut CIrPackage,
1620        members: *mut *mut CIrType,
1621        member_count: i64,
1622    ) -> *mut CIrType;
1623
1624    pub fn xls_package_get_array_type(
1625        package: *mut CIrPackage,
1626        element_type: *mut CIrType,
1627        size: i64,
1628    ) -> *mut CIrType;
1629
1630    pub fn xls_package_get_token_type(package: *mut CIrPackage) -> *mut CIrType;
1631
1632    pub fn xls_function_builder_create(
1633        name: *const std::os::raw::c_char,
1634        package: *mut CIrPackage,
1635        should_verify: bool,
1636    ) -> *mut CIrFunctionBuilder;
1637    pub fn xls_function_builder_as_builder_base(
1638        builder: *mut CIrFunctionBuilder,
1639    ) -> *mut CIrBuilderBase;
1640    pub fn xls_function_builder_free(builder: *mut CIrFunctionBuilder);
1641    pub fn xls_bvalue_free(bvalue: *mut CIrBValue);
1642    pub fn xls_function_builder_add_parameter(
1643        builder: *mut CIrFunctionBuilder,
1644        name: *const std::os::raw::c_char,
1645        type_: *mut CIrType,
1646    ) -> *mut CIrBValue;
1647    pub fn xls_function_builder_build(
1648        builder: *mut CIrFunctionBuilder,
1649        error_out: *mut *mut std::os::raw::c_char,
1650        function_out: *mut *mut CIrFunction,
1651    ) -> bool;
1652    pub fn xls_function_builder_build_with_return_value(
1653        builder: *mut CIrFunctionBuilder,
1654        return_value: *mut CIrBValue,
1655        error_out: *mut *mut std::os::raw::c_char,
1656        function_out: *mut *mut CIrFunction,
1657    ) -> bool;
1658    pub fn xls_builder_base_add_and(
1659        builder: *mut CIrBuilderBase,
1660        lhs: *mut CIrBValue,
1661        rhs: *mut CIrBValue,
1662        name: *const std::os::raw::c_char,
1663    ) -> *mut CIrBValue;
1664    pub fn xls_builder_base_add_nand(
1665        builder: *mut CIrBuilderBase,
1666        lhs: *mut CIrBValue,
1667        rhs: *mut CIrBValue,
1668        name: *const std::os::raw::c_char,
1669    ) -> *mut CIrBValue;
1670    pub fn xls_builder_base_add_or(
1671        builder: *mut CIrBuilderBase,
1672        lhs: *mut CIrBValue,
1673        rhs: *mut CIrBValue,
1674        name: *const std::os::raw::c_char,
1675    ) -> *mut CIrBValue;
1676    pub fn xls_builder_base_add_xor(
1677        builder: *mut CIrBuilderBase,
1678        lhs: *mut CIrBValue,
1679        rhs: *mut CIrBValue,
1680        name: *const std::os::raw::c_char,
1681    ) -> *mut CIrBValue;
1682    pub fn xls_builder_base_add_not(
1683        builder: *mut CIrBuilderBase,
1684        value: *mut CIrBValue,
1685        name: *const std::os::raw::c_char,
1686    ) -> *mut CIrBValue;
1687    pub fn xls_builder_base_add_negate(
1688        builder: *mut CIrBuilderBase,
1689        value: *mut CIrBValue,
1690        name: *const std::os::raw::c_char,
1691    ) -> *mut CIrBValue;
1692    pub fn xls_builder_base_add_reverse(
1693        builder: *mut CIrBuilderBase,
1694        value: *mut CIrBValue,
1695        name: *const std::os::raw::c_char,
1696    ) -> *mut CIrBValue;
1697    pub fn xls_builder_base_add_or_reduce(
1698        builder: *mut CIrBuilderBase,
1699        value: *mut CIrBValue,
1700        name: *const std::os::raw::c_char,
1701    ) -> *mut CIrBValue;
1702    pub fn xls_builder_base_add_and_reduce(
1703        builder: *mut CIrBuilderBase,
1704        value: *mut CIrBValue,
1705        name: *const std::os::raw::c_char,
1706    ) -> *mut CIrBValue;
1707    pub fn xls_builder_base_add_xor_reduce(
1708        builder: *mut CIrBuilderBase,
1709        value: *mut CIrBValue,
1710        name: *const std::os::raw::c_char,
1711    ) -> *mut CIrBValue;
1712    pub fn xls_builder_base_add_literal(
1713        builder: *mut CIrBuilderBase,
1714        value: *mut CIrValue,
1715        name: *const std::os::raw::c_char,
1716    ) -> *mut CIrBValue;
1717    pub fn xls_builder_base_add_tuple(
1718        builder: *mut CIrBuilderBase,
1719        operands: *mut *mut CIrBValue,
1720        operand_count: i64,
1721        name: *const std::os::raw::c_char,
1722    ) -> *mut CIrBValue;
1723    pub fn xls_builder_base_add_tuple_index(
1724        builder: *mut CIrBuilderBase,
1725        tuple: *mut CIrBValue,
1726        index: i64,
1727        name: *const std::os::raw::c_char,
1728    ) -> *mut CIrBValue;
1729    pub fn xls_builder_base_add_array(
1730        builder: *mut CIrBuilderBase,
1731        element_type: *mut CIrType,
1732        elements: *const *mut CIrBValue,
1733        element_count: i64,
1734        name: *const std::os::raw::c_char,
1735    ) -> *mut CIrBValue;
1736    pub fn xls_builder_base_add_array_index(
1737        builder: *mut CIrBuilderBase,
1738        array: *mut CIrBValue,
1739        indices: *const *mut CIrBValue,
1740        index_count: i64,
1741        assumed_in_bounds: bool,
1742        name: *const std::os::raw::c_char,
1743    ) -> *mut CIrBValue;
1744    pub fn xls_builder_base_add_dynamic_bit_slice(
1745        builder: *mut CIrBuilderBase,
1746        value: *mut CIrBValue,
1747        start: *mut CIrBValue,
1748        width: i64,
1749        name: *const std::os::raw::c_char,
1750    ) -> *mut CIrBValue;
1751    pub fn xls_builder_base_add_bit_slice(
1752        builder: *mut CIrBuilderBase,
1753        value: *mut CIrBValue,
1754        start: i64,
1755        width: i64,
1756        name: *const std::os::raw::c_char,
1757    ) -> *mut CIrBValue;
1758    pub fn xls_builder_base_add_bit_slice_update(
1759        builder: *mut CIrBuilderBase,
1760        value: *mut CIrBValue,
1761        start: *mut CIrBValue,
1762        update: *mut CIrBValue,
1763        name: *const std::os::raw::c_char,
1764    ) -> *mut CIrBValue;
1765    pub fn xls_builder_base_add_concat(
1766        builder: *mut CIrBuilderBase,
1767        values: *const *mut CIrBValue,
1768        value_count: i64,
1769        name: *const std::os::raw::c_char,
1770    ) -> *mut CIrBValue;
1771    pub fn xls_builder_base_add_after_all(
1772        builder: *mut CIrBuilderBase,
1773        dependencies: *mut *mut CIrBValue,
1774        dependency_count: i64,
1775        name: *const std::os::raw::c_char,
1776    ) -> *mut CIrBValue;
1777    pub fn xls_builder_base_add_add(
1778        builder: *mut CIrBuilderBase,
1779        lhs: *mut CIrBValue,
1780        rhs: *mut CIrBValue,
1781        name: *const std::os::raw::c_char,
1782    ) -> *mut CIrBValue;
1783    pub fn xls_builder_base_add_sub(
1784        builder: *mut CIrBuilderBase,
1785        lhs: *mut CIrBValue,
1786        rhs: *mut CIrBValue,
1787        name: *const std::os::raw::c_char,
1788    ) -> *mut CIrBValue;
1789    pub fn xls_builder_base_add_umul(
1790        builder: *mut CIrBuilderBase,
1791        lhs: *mut CIrBValue,
1792        rhs: *mut CIrBValue,
1793        name: *const std::os::raw::c_char,
1794    ) -> *mut CIrBValue;
1795    pub fn xls_builder_base_add_smul(
1796        builder: *mut CIrBuilderBase,
1797        lhs: *mut CIrBValue,
1798        rhs: *mut CIrBValue,
1799        name: *const std::os::raw::c_char,
1800    ) -> *mut CIrBValue;
1801    pub fn xls_builder_base_add_umulp(
1802        builder: *mut CIrBuilderBase,
1803        lhs: *mut CIrBValue,
1804        rhs: *mut CIrBValue,
1805        name: *const std::os::raw::c_char,
1806    ) -> *mut CIrBValue;
1807    pub fn xls_builder_base_add_smulp(
1808        builder: *mut CIrBuilderBase,
1809        lhs: *mut CIrBValue,
1810        rhs: *mut CIrBValue,
1811        name: *const std::os::raw::c_char,
1812    ) -> *mut CIrBValue;
1813    pub fn xls_builder_base_add_udiv(
1814        builder: *mut CIrBuilderBase,
1815        lhs: *mut CIrBValue,
1816        rhs: *mut CIrBValue,
1817        name: *const std::os::raw::c_char,
1818    ) -> *mut CIrBValue;
1819    pub fn xls_builder_base_add_sdiv(
1820        builder: *mut CIrBuilderBase,
1821        lhs: *mut CIrBValue,
1822        rhs: *mut CIrBValue,
1823        name: *const std::os::raw::c_char,
1824    ) -> *mut CIrBValue;
1825    pub fn xls_builder_base_add_umod(
1826        builder: *mut CIrBuilderBase,
1827        lhs: *mut CIrBValue,
1828        rhs: *mut CIrBValue,
1829        name: *const std::os::raw::c_char,
1830    ) -> *mut CIrBValue;
1831    pub fn xls_builder_base_add_smod(
1832        builder: *mut CIrBuilderBase,
1833        lhs: *mut CIrBValue,
1834        rhs: *mut CIrBValue,
1835        name: *const std::os::raw::c_char,
1836    ) -> *mut CIrBValue;
1837    pub fn xls_builder_base_add_eq(
1838        builder: *mut CIrBuilderBase,
1839        lhs: *mut CIrBValue,
1840        rhs: *mut CIrBValue,
1841        name: *const std::os::raw::c_char,
1842    ) -> *mut CIrBValue;
1843    pub fn xls_builder_base_add_ne(
1844        builder: *mut CIrBuilderBase,
1845        lhs: *mut CIrBValue,
1846        rhs: *mut CIrBValue,
1847        name: *const std::os::raw::c_char,
1848    ) -> *mut CIrBValue;
1849
1850    // -- comparisons
1851    pub fn xls_builder_base_add_ule(
1852        builder: *mut CIrBuilderBase,
1853        lhs: *mut CIrBValue,
1854        rhs: *mut CIrBValue,
1855        name: *const std::os::raw::c_char,
1856    ) -> *mut CIrBValue;
1857    pub fn xls_builder_base_add_ult(
1858        builder: *mut CIrBuilderBase,
1859        lhs: *mut CIrBValue,
1860        rhs: *mut CIrBValue,
1861        name: *const std::os::raw::c_char,
1862    ) -> *mut CIrBValue;
1863    pub fn xls_builder_base_add_uge(
1864        builder: *mut CIrBuilderBase,
1865        lhs: *mut CIrBValue,
1866        rhs: *mut CIrBValue,
1867        name: *const std::os::raw::c_char,
1868    ) -> *mut CIrBValue;
1869    pub fn xls_builder_base_add_ugt(
1870        builder: *mut CIrBuilderBase,
1871        lhs: *mut CIrBValue,
1872        rhs: *mut CIrBValue,
1873        name: *const std::os::raw::c_char,
1874    ) -> *mut CIrBValue;
1875    pub fn xls_builder_base_add_sle(
1876        builder: *mut CIrBuilderBase,
1877        lhs: *mut CIrBValue,
1878        rhs: *mut CIrBValue,
1879        name: *const std::os::raw::c_char,
1880    ) -> *mut CIrBValue;
1881    pub fn xls_builder_base_add_slt(
1882        builder: *mut CIrBuilderBase,
1883        lhs: *mut CIrBValue,
1884        rhs: *mut CIrBValue,
1885        name: *const std::os::raw::c_char,
1886    ) -> *mut CIrBValue;
1887    pub fn xls_builder_base_add_sgt(
1888        builder: *mut CIrBuilderBase,
1889        lhs: *mut CIrBValue,
1890        rhs: *mut CIrBValue,
1891        name: *const std::os::raw::c_char,
1892    ) -> *mut CIrBValue;
1893    pub fn xls_builder_base_add_sge(
1894        builder: *mut CIrBuilderBase,
1895        lhs: *mut CIrBValue,
1896        rhs: *mut CIrBValue,
1897        name: *const std::os::raw::c_char,
1898    ) -> *mut CIrBValue;
1899
1900    pub fn xls_builder_base_add_shra(
1901        builder: *mut CIrBuilderBase,
1902        a: *mut CIrBValue,
1903        b: *mut CIrBValue,
1904        name: *const std::os::raw::c_char,
1905    ) -> *mut CIrBValue;
1906    pub fn xls_builder_base_add_shrl(
1907        builder: *mut CIrBuilderBase,
1908        a: *mut CIrBValue,
1909        b: *mut CIrBValue,
1910        name: *const std::os::raw::c_char,
1911    ) -> *mut CIrBValue;
1912    pub fn xls_builder_base_add_shll(
1913        builder: *mut CIrBuilderBase,
1914        a: *mut CIrBValue,
1915        b: *mut CIrBValue,
1916        name: *const std::os::raw::c_char,
1917    ) -> *mut CIrBValue;
1918    pub fn xls_builder_base_add_nor(
1919        builder: *mut CIrBuilderBase,
1920        a: *mut CIrBValue,
1921        b: *mut CIrBValue,
1922        name: *const std::os::raw::c_char,
1923    ) -> *mut CIrBValue;
1924    pub fn xls_builder_base_add_clz(
1925        builder: *mut CIrBuilderBase,
1926        a: *mut CIrBValue,
1927        name: *const std::os::raw::c_char,
1928    ) -> *mut CIrBValue;
1929    pub fn xls_builder_base_add_ctz(
1930        builder: *mut CIrBuilderBase,
1931        a: *mut CIrBValue,
1932        name: *const std::os::raw::c_char,
1933    ) -> *mut CIrBValue;
1934    pub fn xls_builder_base_add_encode(
1935        builder: *mut CIrBuilderBase,
1936        a: *mut CIrBValue,
1937        name: *const std::os::raw::c_char,
1938    ) -> *mut CIrBValue;
1939
1940    pub fn xls_builder_base_add_decode(
1941        builder: *mut CIrBuilderBase,
1942        a: *mut CIrBValue,
1943        width: *mut i64,
1944        name: *const std::os::raw::c_char,
1945    ) -> *mut CIrBValue;
1946    pub fn xls_builder_base_add_select(
1947        builder: *mut CIrBuilderBase,
1948        selector: *mut CIrBValue,
1949        cases: *const *mut CIrBValue,
1950        case_count: i64,
1951        default_value: *mut CIrBValue,
1952        name: *const std::os::raw::c_char,
1953    ) -> *mut CIrBValue;
1954    pub fn xls_builder_base_add_array_concat(
1955        builder: *mut CIrBuilderBase,
1956        arrays: *const *mut CIrBValue,
1957        array_count: i64,
1958        name: *const std::os::raw::c_char,
1959    ) -> *mut CIrBValue;
1960    pub fn xls_builder_base_add_array_slice(
1961        builder: *mut CIrBuilderBase,
1962        array: *mut CIrBValue,
1963        start: *mut CIrBValue,
1964        width: i64,
1965        name: *const std::os::raw::c_char,
1966    ) -> *mut CIrBValue;
1967    pub fn xls_builder_base_add_array_update(
1968        builder: *mut CIrBuilderBase,
1969        array: *mut CIrBValue,
1970        update_value: *mut CIrBValue,
1971        indices: *const *mut CIrBValue,
1972        index_count: i64,
1973        assumed_in_bounds: bool,
1974        name: *const std::os::raw::c_char,
1975    ) -> *mut CIrBValue;
1976    pub fn xls_builder_base_add_identity(
1977        builder: *mut CIrBuilderBase,
1978        value: *mut CIrBValue,
1979        name: *const std::os::raw::c_char,
1980    ) -> *mut CIrBValue;
1981
1982    pub fn xls_builder_base_add_sign_extend(
1983        builder: *mut CIrBuilderBase,
1984        value: *mut CIrBValue,
1985        new_bit_count: i64,
1986        name: *const std::os::raw::c_char,
1987    ) -> *mut CIrBValue;
1988    pub fn xls_builder_base_add_zero_extend(
1989        builder: *mut CIrBuilderBase,
1990        value: *mut CIrBValue,
1991        new_bit_count: i64,
1992        name: *const std::os::raw::c_char,
1993    ) -> *mut CIrBValue;
1994
1995    pub fn xls_builder_base_add_one_hot(
1996        builder: *mut CIrBuilderBase,
1997        input: *mut CIrBValue,
1998        lsb_is_priority: bool,
1999        name: *const std::os::raw::c_char,
2000    ) -> *mut CIrBValue;
2001
2002    pub fn xls_builder_base_add_one_hot_select(
2003        builder: *mut CIrBuilderBase,
2004        selector: *mut CIrBValue,
2005        cases: *const *mut CIrBValue,
2006        case_count: i64,
2007        name: *const std::os::raw::c_char,
2008    ) -> *mut CIrBValue;
2009
2010    pub fn xls_builder_base_add_priority_select(
2011        builder: *mut CIrBuilderBase,
2012        selector: *mut CIrBValue,
2013        cases: *const *mut CIrBValue,
2014        case_count: i64,
2015        default_value: *mut CIrBValue,
2016        name: *const std::os::raw::c_char,
2017    ) -> *mut CIrBValue;
2018
2019    pub fn xls_builder_base_get_last_value(
2020        builder: *mut CIrBuilderBase,
2021        error_out: *mut *mut std::os::raw::c_char,
2022        value_out: *mut *mut CIrBValue,
2023    ) -> bool;
2024
2025    pub fn xls_builder_base_get_type(
2026        builder: *mut CIrBuilderBase,
2027        value: *mut CIrBValue,
2028    ) -> *mut CIrType;
2029
2030    // New functions for sequential logic
2031    pub fn xls_vast_verilog_module_add_always_ff(
2032        m: *mut CVastModule,
2033        sensitivity_list_elements: *mut *mut CVastExpression,
2034        sensitivity_list_count: usize,
2035        out_always_ff: *mut *mut CVastAlwaysBase,
2036        error_out: *mut *mut ::std::os::raw::c_char,
2037    ) -> bool;
2038    pub fn xls_vast_verilog_module_add_always_at(
2039        m: *mut CVastModule,
2040        sensitivity_list_elements: *mut *mut CVastExpression,
2041        sensitivity_list_count: usize,
2042        out_always_at: *mut *mut CVastAlwaysBase,
2043        error_out: *mut *mut ::std::os::raw::c_char,
2044    ) -> bool;
2045    pub fn xls_vast_verilog_module_add_always_comb(
2046        m: *mut CVastModule,
2047        out_always_comb: *mut *mut CVastAlwaysBase,
2048        error_out: *mut *mut ::std::os::raw::c_char,
2049    ) -> bool;
2050    pub fn xls_vast_verilog_module_add_reg(
2051        m: *mut CVastModule,
2052        name: *const ::std::os::raw::c_char,
2053        type_: *mut CVastDataType,
2054        out_reg_ref: *mut *mut CVastLogicRef,
2055        error_out: *mut *mut ::std::os::raw::c_char,
2056    ) -> bool;
2057    pub fn xls_vast_verilog_module_add_logic(
2058        m: *mut CVastModule,
2059        name: *const std::os::raw::c_char,
2060        type_: *mut CVastDataType,
2061        out_logic_ref: *mut *mut CVastLogicRef,
2062        error_out: *mut *mut std::os::raw::c_char,
2063    ) -> bool;
2064    pub fn xls_vast_verilog_file_make_pos_edge(
2065        f: *mut CVastFile,
2066        signal_expr: *mut CVastExpression,
2067    ) -> *mut CVastExpression;
2068    pub fn xls_vast_verilog_file_make_nonblocking_assignment(
2069        f: *mut CVastFile,
2070        lhs: *mut CVastExpression,
2071        rhs: *mut CVastExpression,
2072    ) -> *mut CVastStatement;
2073    pub fn xls_vast_verilog_file_make_blocking_assignment(
2074        f: *mut CVastFile,
2075        lhs: *mut CVastExpression,
2076        rhs: *mut CVastExpression,
2077    ) -> *mut CVastStatement;
2078
2079    pub fn xls_vast_always_base_get_statement_block(
2080        always_base: *mut CVastAlwaysBase,
2081    ) -> *mut CVastStatementBlock;
2082
2083    pub fn xls_vast_statement_block_add_nonblocking_assignment(
2084        block: *mut CVastStatementBlock,
2085        lhs: *mut CVastExpression,
2086        rhs: *mut CVastExpression,
2087    ) -> *mut CVastStatement;
2088    pub fn xls_vast_statement_block_add_blocking_assignment(
2089        block: *mut CVastStatementBlock,
2090        lhs: *mut CVastExpression,
2091        rhs: *mut CVastExpression,
2092    ) -> *mut CVastStatement;
2093
2094    pub fn xls_vast_statement_block_add_comment_text(
2095        block: *mut CVastStatementBlock,
2096        text: *const std::os::raw::c_char,
2097    ) -> *mut CVastStatement;
2098
2099    pub fn xls_vast_statement_block_add_blank_line(
2100        block: *mut CVastStatementBlock,
2101    ) -> *mut CVastStatement;
2102
2103    pub fn xls_vast_statement_block_add_inline_text(
2104        block: *mut CVastStatementBlock,
2105        text: *const std::os::raw::c_char,
2106    ) -> *mut CVastStatement;
2107    pub fn xls_vast_statement_block_add_generate_loop(
2108        block: *mut CVastStatementBlock,
2109        genvar_name: *const std::os::raw::c_char,
2110        init: *mut CVastExpression,
2111        limit: *mut CVastExpression,
2112        label: *const std::os::raw::c_char,
2113    ) -> *mut CVastGenerateLoop;
2114
2115    pub fn xls_vast_statement_block_add_continuous_assignment(
2116        block: *mut CVastStatementBlock,
2117        lhs: *mut CVastExpression,
2118        rhs: *mut CVastExpression,
2119    ) -> *mut CVastStatement;
2120
2121    // Conditional (if / else-if / else)
2122    pub fn xls_vast_statement_block_add_conditional(
2123        block: *mut CVastStatementBlock,
2124        cond: *mut CVastExpression,
2125    ) -> *mut CVastConditional;
2126    pub fn xls_vast_conditional_get_then_block(
2127        cond: *mut CVastConditional,
2128    ) -> *mut CVastStatementBlock;
2129    pub fn xls_vast_conditional_add_else_if(
2130        cond: *mut CVastConditional,
2131        expr_cond: *mut CVastExpression,
2132    ) -> *mut CVastStatementBlock;
2133    pub fn xls_vast_conditional_add_else(cond: *mut CVastConditional) -> *mut CVastStatementBlock;
2134
2135    // Case statement builders
2136    pub fn xls_vast_statement_block_add_case(
2137        block: *mut CVastStatementBlock,
2138        selector: *mut CVastExpression,
2139    ) -> *mut CVastCaseStatement;
2140    pub fn xls_vast_case_statement_add_item(
2141        case_stmt: *mut CVastCaseStatement,
2142        match_expr: *mut CVastExpression,
2143    ) -> *mut CVastStatementBlock;
2144    pub fn xls_vast_case_statement_add_default(
2145        case_stmt: *mut CVastCaseStatement,
2146    ) -> *mut CVastStatementBlock;
2147
2148    pub fn xls_vast_generate_loop_get_genvar(loop_: *mut CVastGenerateLoop) -> *mut CVastLogicRef;
2149
2150    pub fn xls_vast_generate_loop_add_statement(
2151        loop_: *mut CVastGenerateLoop,
2152        statement: *mut CVastStatement,
2153    );
2154    pub fn xls_vast_generate_loop_add_generate_loop(
2155        loop_: *mut CVastGenerateLoop,
2156        genvar_name: *const std::os::raw::c_char,
2157        init: *mut CVastExpression,
2158        limit: *mut CVastExpression,
2159        label: *const std::os::raw::c_char,
2160    ) -> *mut CVastGenerateLoop;
2161    pub fn xls_vast_generate_loop_add_always_comb(
2162        loop_: *mut CVastGenerateLoop,
2163        out_always_comb: *mut *mut CVastAlwaysBase,
2164        error_out: *mut *mut std::os::raw::c_char,
2165    ) -> bool;
2166    pub fn xls_vast_generate_loop_add_always_ff(
2167        loop_: *mut CVastGenerateLoop,
2168        sensitivity_list_elements: *mut *mut CVastExpression,
2169        sensitivity_list_count: usize,
2170        out_always_ff: *mut *mut CVastAlwaysBase,
2171        error_out: *mut *mut std::os::raw::c_char,
2172    ) -> bool;
2173    pub fn xls_vast_generate_loop_add_localparam(
2174        loop_: *mut CVastGenerateLoop,
2175        name: *const std::os::raw::c_char,
2176        rhs: *mut CVastExpression,
2177    ) -> *mut CVastLocalparamRef;
2178    pub fn xls_vast_generate_loop_add_localparam_with_def(
2179        loop_: *mut CVastGenerateLoop,
2180        def: *mut CVastDef,
2181        rhs: *mut CVastExpression,
2182    ) -> *mut CVastLocalparamRef;
2183    pub fn xls_vast_generate_loop_add_continuous_assignment(
2184        loop_: *mut CVastGenerateLoop,
2185        lhs: *mut CVastExpression,
2186        rhs: *mut CVastExpression,
2187    ) -> *mut CVastStatement;
2188    pub fn xls_vast_generate_loop_add_blank_line(loop_: *mut CVastGenerateLoop);
2189    pub fn xls_vast_generate_loop_add_comment(
2190        loop_: *mut CVastGenerateLoop,
2191        comment: *mut CVastComment,
2192    );
2193    pub fn xls_vast_generate_loop_add_instantiation(
2194        loop_: *mut CVastGenerateLoop,
2195        instantiation: *mut CVastInstantiation,
2196    );
2197    pub fn xls_vast_generate_loop_add_inline_verilog_statement(
2198        loop_: *mut CVastGenerateLoop,
2199        stmt: *mut CVastInlineVerilogStatement,
2200    );
2201    pub fn xls_vast_generate_loop_add_macro_statement(
2202        loop_: *mut CVastGenerateLoop,
2203        macro_ref: *mut CVastMacroRef,
2204    );
2205
2206    pub fn xls_function_type_get_param_count(fty: *mut CIrFunctionType) -> i64;
2207
2208    pub fn xls_function_type_get_param_type(
2209        fty: *mut CIrFunctionType,
2210        index: libc::size_t,
2211        error_out: *mut *mut std::os::raw::c_char,
2212        param_type_out: *mut *mut CIrType,
2213    ) -> bool;
2214
2215    pub fn xls_function_type_get_return_type(fty: *mut CIrFunctionType) -> *mut CIrType;
2216
2217    pub fn xls_function_get_param_name(
2218        function: *mut CIrFunction,
2219        index: libc::size_t,
2220        error_out: *mut *mut std::os::raw::c_char,
2221        name_out: *mut *mut std::os::raw::c_char,
2222    ) -> bool;
2223
2224    pub fn xls_dslx_module_member_get_function(
2225        member: *const CDslxModuleMember,
2226    ) -> *mut CDslxFunction;
2227    pub fn xls_dslx_function_is_parametric(function: *const CDslxFunction) -> bool;
2228    pub fn xls_dslx_function_get_identifier(
2229        function: *const CDslxFunction,
2230    ) -> *mut std::os::raw::c_char;
2231
2232    pub fn xls_dslx_function_get_param_count(function: *const CDslxFunction) -> i64;
2233    pub fn xls_dslx_function_get_param(
2234        function: *const CDslxFunction,
2235        index: i64,
2236    ) -> *mut CDslxParam;
2237    pub fn xls_dslx_param_get_name(param: *const CDslxParam) -> *mut std::os::raw::c_char;
2238    pub fn xls_dslx_param_get_type_annotation(param: *const CDslxParam)
2239        -> *mut CDslxTypeAnnotation;
2240
2241    // -- "requires implicit token?" determination for a DSLX function
2242    pub fn xls_dslx_type_info_get_requires_implicit_token(
2243        type_info: *mut CDslxTypeInfo,
2244        function: *mut CDslxFunction,
2245        error_out: *mut *mut std::os::raw::c_char,
2246        result_out: *mut bool,
2247    ) -> bool;
2248
2249    // -- Quickcheck APIs
2250    pub fn xls_dslx_module_member_get_quickcheck(
2251        member: *const CDslxModuleMember,
2252    ) -> *mut CDslxQuickcheck;
2253
2254    pub fn xls_dslx_quickcheck_get_function(qc: *const CDslxQuickcheck) -> *mut CDslxFunction;
2255
2256    /// Returns true iff the Quickcheck has the `exhaustive` test-cases
2257    /// specifier.
2258    pub fn xls_dslx_quickcheck_is_exhaustive(qc: *const CDslxQuickcheck) -> bool;
2259
2260    /// Retrieves the test-case count for the Quickcheck. Returns true and sets
2261    /// `*result_out` when the Quickcheck has a counted test-case specifier;
2262    /// returns false when the Quickcheck is marked exhaustive (in which case
2263    /// `*result_out` is not modified).
2264    pub fn xls_dslx_quickcheck_get_count(qc: *const CDslxQuickcheck, result_out: *mut i64) -> bool;
2265}
2266
2267pub const DSLX_STDLIB_PATH: &str = env!("DSLX_STDLIB_PATH");
2268
2269/// Directory containing the libxls DSO.
2270///
2271/// *** DO NOT USE THIS VARIABLE FROM WITHIN YOUR build.rs ***
2272///
2273/// You might be tempted to write the following in your build.rs:
2274///
2275/// ```ignore
2276/// // DO NOT DO THIS IN YOUR build.rs!!
2277/// let dylib_dirpath = xlsynth_sys::XLS_DSO_PATH;
2278/// // set rpath to dylib_dirpath or something.
2279/// ```
2280///
2281/// The problem is that build.rs is compiled for host, whereas if you're setting
2282/// an rpath (or something similar) you want to get the path from compiling
2283/// xlsynth_sys for *target*.  In other words, the above will break
2284/// cross-compilation.
2285///
2286/// Instead, your build.rs should get the path from an envvar which:
2287///
2288/// ```ignore
2289/// // Do this from your build.rs instead.
2290/// let dylib_path = std::env::var("DEP_XLSYNTH_DSO_PATH").unwrap();
2291/// ```
2292///
2293/// More details are available at
2294/// <https://doc.rust-lang.org/cargo/reference/build-script-examples.html#using-another-sys-crate>.
2295///
2296/// (If you use this envvar from your crate proper -- i.e. not from build.rs --
2297/// then it's perfectly fine.)
2298pub const XLS_DSO_PATH: &str = env!("XLS_DSO_PATH");
2299
2300// Add opaque types for module port and def.
2301#[repr(C)]
2302pub struct CVastModulePort {
2303    _private: [u8; 0], // Ensures the struct cannot be instantiated
2304}
2305
2306#[repr(C)]
2307pub struct CVastDef {
2308    _private: [u8; 0], // Ensures the struct cannot be instantiated
2309}
2310
2311// Direction enum for module ports.
2312pub type VastModulePortDirection = i32;
2313
2314// Constants that match the C enum definitions.
2315pub const XLS_VAST_MODULE_PORT_DIRECTION_INPUT: VastModulePortDirection = 0;
2316pub const XLS_VAST_MODULE_PORT_DIRECTION_OUTPUT: VastModulePortDirection = 1;
2317
2318extern "C" {
2319    // -- Module port inspection APIs
2320    pub fn xls_vast_verilog_module_get_ports(
2321        m: *mut CVastModule,
2322        out_count: *mut libc::size_t,
2323    ) -> *mut *mut CVastModulePort;
2324
2325    pub fn xls_vast_verilog_module_free_ports(
2326        ports: *mut *mut CVastModulePort,
2327        count: libc::size_t,
2328    );
2329
2330    pub fn xls_vast_verilog_module_port_get_direction(
2331        port: *mut CVastModulePort,
2332    ) -> VastModulePortDirection;
2333
2334    pub fn xls_vast_verilog_module_port_get_def(port: *mut CVastModulePort) -> *mut CVastDef;
2335
2336    pub fn xls_vast_def_get_name(def: *mut CVastDef) -> *mut std::os::raw::c_char;
2337
2338    pub fn xls_vast_def_get_data_type(def: *mut CVastDef) -> *mut CVastDataType;
2339}