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    pub fn xls_vast_expression_emit(expr: *mut CVastExpression) -> *mut std::os::raw::c_char;
1121
1122    // -- DSLX
1123
1124    pub fn xls_dslx_import_data_create(
1125        dslx_stdlib_path: *const std::os::raw::c_char,
1126        additional_search_paths: *const *const std::os::raw::c_char,
1127        additional_search_paths_count: libc::size_t,
1128    ) -> *mut CDslxImportData;
1129    pub fn xls_dslx_import_data_free(data: *mut CDslxImportData);
1130
1131    pub fn xls_dslx_parse_and_typecheck(
1132        text: *const std::os::raw::c_char,
1133        path: *const std::os::raw::c_char,
1134        module_name: *const std::os::raw::c_char,
1135        import_data: *const CDslxImportData,
1136        error_out: *mut *mut std::os::raw::c_char,
1137        typechecked_module_out: *mut *mut CDslxTypecheckedModule,
1138    ) -> bool;
1139
1140    pub fn xls_dslx_typechecked_module_clone_removing_functions(
1141        tm: *mut CDslxTypecheckedModule,
1142        functions: *mut *mut CDslxFunction,
1143        function_count: libc::size_t,
1144        install_subject: *const std::os::raw::c_char,
1145        import_data: *mut CDslxImportData,
1146        error_out: *mut *mut std::os::raw::c_char,
1147        result_out: *mut *mut CDslxTypecheckedModule,
1148    ) -> bool;
1149
1150    pub fn xls_dslx_replace_invocations_in_module(
1151        tm: *mut CDslxTypecheckedModule,
1152        callers: *const *mut CDslxFunction,
1153        callers_count: libc::size_t,
1154        rules: *const CDslxInvocationRewriteRule,
1155        rules_count: libc::size_t,
1156        import_data: *mut CDslxImportData,
1157        install_subject: *const std::os::raw::c_char,
1158        error_out: *mut *mut std::os::raw::c_char,
1159        result_out: *mut *mut CDslxTypecheckedModule,
1160    ) -> bool;
1161
1162    pub fn xls_dslx_typechecked_module_insert_function_specializations(
1163        typechecked_module: *mut CDslxTypecheckedModule,
1164        requests: *const XlsDslxFunctionSpecializationRequest,
1165        request_count: libc::size_t,
1166        import_data: *mut CDslxImportData,
1167        install_subject: *const std::os::raw::c_char,
1168        error_out: *mut *mut std::os::raw::c_char,
1169        result_out: *mut *mut CDslxTypecheckedModule,
1170    ) -> bool;
1171
1172    // bool xls_schedule_and_codegen_package(
1173    // struct xls_package* p, const char* scheduling_options_flags_proto,
1174    // const char* codegen_flags_proto, bool with_delay_model, char** error_out,
1175    // struct xls_schedule_and_codegen_result** result_out);
1176    pub fn xls_schedule_and_codegen_package(
1177        p: *mut CIrPackage,
1178        scheduling_options_flags_proto: *const std::os::raw::c_char,
1179        codegen_flags_proto: *const std::os::raw::c_char,
1180        with_delay_model: bool,
1181        error_out: *mut *mut std::os::raw::c_char,
1182        result_out: *mut *mut CScheduleAndCodegenResult,
1183    ) -> bool;
1184
1185    pub fn xls_schedule_and_codegen_result_get_verilog_text(
1186        result: *mut CScheduleAndCodegenResult,
1187    ) -> *mut std::os::raw::c_char;
1188
1189    pub fn xls_schedule_and_codegen_result_free(result: *mut CScheduleAndCodegenResult);
1190
1191    pub fn xls_dslx_typechecked_module_free(module: *mut CDslxTypecheckedModule);
1192
1193    pub fn xls_dslx_typechecked_module_get_module(
1194        module: *mut CDslxTypecheckedModule,
1195    ) -> *mut CDslxModule;
1196
1197    pub fn xls_dslx_typechecked_module_get_type_info(
1198        module: *mut CDslxTypecheckedModule,
1199    ) -> *mut CDslxTypeInfo;
1200
1201    pub fn xls_dslx_module_to_string(module: *mut CDslxModule) -> *mut std::os::raw::c_char;
1202
1203    pub fn xls_dslx_module_get_name(module: *const CDslxModule) -> *mut std::os::raw::c_char;
1204
1205    pub fn xls_dslx_module_get_type_definition_count(module: *const CDslxModule) -> i64;
1206
1207    pub fn xls_dslx_module_get_member_count(module: *const CDslxModule) -> i64;
1208
1209    pub fn xls_dslx_module_get_member(module: *const CDslxModule, i: i64)
1210        -> *mut CDslxModuleMember;
1211
1212    pub fn xls_dslx_module_get_type_definition_kind(
1213        module: *const CDslxModule,
1214        i: i64,
1215    ) -> DslxTypeDefinitionKind;
1216
1217    pub fn xls_dslx_module_get_type_definition_as_struct_def(
1218        module: *const CDslxModule,
1219        i: i64,
1220    ) -> *mut CDslxStructDef;
1221    pub fn xls_dslx_module_get_type_definition_as_enum_def(
1222        module: *const CDslxModule,
1223        i: i64,
1224    ) -> *mut CDslxEnumDef;
1225    pub fn xls_dslx_module_get_type_definition_as_type_alias(
1226        module: *const CDslxModule,
1227        i: i64,
1228    ) -> *mut CDslxTypeAlias;
1229
1230    // -- xls_dslx_module_member
1231    pub fn xls_dslx_module_member_get_kind(
1232        member: *const CDslxModuleMember,
1233    ) -> DslxModuleMemberKind;
1234    pub fn xls_dslx_module_member_get_constant_def(
1235        member: *const CDslxModuleMember,
1236    ) -> *mut CDslxConstantDef;
1237    pub fn xls_dslx_module_member_get_type_alias(
1238        member: *const CDslxModuleMember,
1239    ) -> *mut CDslxTypeAlias;
1240    pub fn xls_dslx_module_member_get_struct_def(
1241        member: *const CDslxModuleMember,
1242    ) -> *mut CDslxStructDef;
1243    pub fn xls_dslx_module_member_get_enum_def(
1244        member: *const CDslxModuleMember,
1245    ) -> *mut CDslxEnumDef;
1246
1247    pub fn xls_dslx_colon_ref_get_attr(
1248        colon_ref: *const CDslxColonRef,
1249    ) -> *mut std::os::raw::c_char;
1250
1251    pub fn xls_dslx_type_info_get_type_struct_def(
1252        type_info: *mut CDslxTypeInfo,
1253        node: *mut CDslxStructDef,
1254    ) -> *mut CDslxType;
1255    pub fn xls_dslx_type_info_get_type_enum_def(
1256        type_info: *mut CDslxTypeInfo,
1257        node: *mut CDslxEnumDef,
1258    ) -> *mut CDslxType;
1259    pub fn xls_dslx_type_info_get_type_struct_member(
1260        type_info: *mut CDslxTypeInfo,
1261        member: *mut CDslxStructMember,
1262    ) -> *mut CDslxType;
1263    pub fn xls_dslx_type_info_get_type_type_alias(
1264        type_info: *mut CDslxTypeInfo,
1265        node: *mut CDslxTypeAlias,
1266    ) -> *mut CDslxType;
1267    pub fn xls_dslx_type_info_get_type_constant_def(
1268        type_info: *mut CDslxTypeInfo,
1269        node: *mut CDslxConstantDef,
1270    ) -> *mut CDslxType;
1271
1272    /// Gets the concrete type for a TypeAnnotation AST node.
1273    pub fn xls_dslx_type_info_get_type_type_annotation(
1274        type_info: *mut CDslxTypeInfo,
1275        type_annotation: *mut CDslxTypeAnnotation,
1276    ) -> *mut CDslxType;
1277
1278    pub fn xls_dslx_type_info_get_imported_type_info(
1279        type_info: *mut CDslxTypeInfo,
1280        module: *mut CDslxModule,
1281    ) -> *mut CDslxTypeInfo;
1282
1283    pub fn xls_dslx_type_info_get_unique_invocation_callee_data(
1284        type_info: *mut CDslxTypeInfo,
1285        function: *mut CDslxFunction,
1286    ) -> *mut CDslxInvocationCalleeDataArray;
1287    pub fn xls_dslx_type_info_get_all_invocation_callee_data(
1288        type_info: *mut CDslxTypeInfo,
1289        function: *mut CDslxFunction,
1290    ) -> *mut CDslxInvocationCalleeDataArray;
1291    pub fn xls_dslx_type_info_get_root_invocation_data(
1292        type_info: *mut CDslxTypeInfo,
1293        invocation: *mut CDslxInvocation,
1294    ) -> *mut CDslxInvocationData;
1295
1296    // -- call_graph
1297    pub fn xls_dslx_type_info_build_function_call_graph(
1298        type_info: *mut CDslxTypeInfo,
1299        error_out: *mut *mut std::os::raw::c_char,
1300        result_out: *mut *mut CDslxCallGraph,
1301    ) -> bool;
1302
1303    pub fn xls_dslx_call_graph_free(call_graph: *mut CDslxCallGraph);
1304
1305    pub fn xls_dslx_call_graph_get_function_count(call_graph: *mut CDslxCallGraph) -> i64;
1306
1307    pub fn xls_dslx_call_graph_get_function(
1308        call_graph: *mut CDslxCallGraph,
1309        index: i64,
1310    ) -> *mut CDslxFunction;
1311
1312    pub fn xls_dslx_call_graph_get_callee_count(
1313        call_graph: *mut CDslxCallGraph,
1314        caller: *mut CDslxFunction,
1315    ) -> i64;
1316
1317    pub fn xls_dslx_call_graph_get_callee_function(
1318        call_graph: *mut CDslxCallGraph,
1319        caller: *mut CDslxFunction,
1320        callee_index: i64,
1321    ) -> *mut CDslxFunction;
1322
1323    pub fn xls_dslx_invocation_callee_data_array_free(array: *mut CDslxInvocationCalleeDataArray);
1324    pub fn xls_dslx_invocation_callee_data_array_get_count(
1325        array: *mut CDslxInvocationCalleeDataArray,
1326    ) -> i64;
1327    pub fn xls_dslx_invocation_callee_data_array_get(
1328        array: *mut CDslxInvocationCalleeDataArray,
1329        index: i64,
1330    ) -> *mut CDslxInvocationCalleeData;
1331
1332    pub fn xls_dslx_invocation_callee_data_clone(
1333        data: *mut CDslxInvocationCalleeData,
1334    ) -> *mut CDslxInvocationCalleeData;
1335    pub fn xls_dslx_invocation_callee_data_free(data: *mut CDslxInvocationCalleeData);
1336    pub fn xls_dslx_invocation_callee_data_get_callee_bindings(
1337        data: *mut CDslxInvocationCalleeData,
1338    ) -> *const CDslxParametricEnv;
1339    pub fn xls_dslx_invocation_callee_data_get_caller_bindings(
1340        data: *mut CDslxInvocationCalleeData,
1341    ) -> *const CDslxParametricEnv;
1342    pub fn xls_dslx_invocation_callee_data_get_derived_type_info(
1343        data: *mut CDslxInvocationCalleeData,
1344    ) -> *mut CDslxTypeInfo;
1345    pub fn xls_dslx_invocation_callee_data_get_invocation(
1346        data: *mut CDslxInvocationCalleeData,
1347    ) -> *mut CDslxInvocation;
1348
1349    pub fn xls_dslx_invocation_data_get_invocation(
1350        data: *mut CDslxInvocationData,
1351    ) -> *mut CDslxInvocation;
1352    pub fn xls_dslx_invocation_data_get_callee(
1353        data: *mut CDslxInvocationData,
1354    ) -> *mut CDslxFunction;
1355    pub fn xls_dslx_invocation_data_get_caller(
1356        data: *mut CDslxInvocationData,
1357    ) -> *mut CDslxFunction;
1358
1359    // -- ConstantDef
1360
1361    pub fn xls_dslx_constant_def_get_name(
1362        constant_def: *const CDslxConstantDef,
1363    ) -> *mut std::os::raw::c_char;
1364
1365    pub fn xls_dslx_constant_def_get_value(constant_def: *const CDslxConstantDef)
1366        -> *mut CDslxExpr;
1367
1368    // -- TypeAlias
1369
1370    pub fn xls_dslx_type_alias_get_identifier(
1371        type_alias: *const CDslxTypeAlias,
1372    ) -> *mut std::os::raw::c_char;
1373
1374    pub fn xls_dslx_type_alias_get_type_annotation(
1375        type_alias: *const CDslxTypeAlias,
1376    ) -> *mut CDslxTypeAnnotation;
1377
1378    // -- TypeAnnotation
1379
1380    pub fn xls_dslx_type_annotation_get_type_ref_type_annotation(
1381        type_annotation: *const CDslxTypeAnnotation,
1382    ) -> *mut CDslxTypeRefTypeAnnotation;
1383
1384    // -- TypeRef
1385
1386    pub fn xls_dslx_type_ref_get_type_definition(
1387        type_ref: *const CDslxTypeRef,
1388    ) -> *mut CDslxTypeDefinition;
1389
1390    // -- Import
1391
1392    pub fn xls_dslx_import_get_subject_count(import: *const CDslxImport) -> i64;
1393    pub fn xls_dslx_import_get_subject(
1394        import: *const CDslxImport,
1395        i: i64,
1396    ) -> *mut std::os::raw::c_char;
1397
1398    // -- ColonRef
1399
1400    pub fn xls_dslx_colon_ref_resolve_import_subject(
1401        colon_ref: *const CDslxColonRef,
1402    ) -> *mut CDslxImport;
1403
1404    // -- TypeDefinition
1405
1406    pub fn xls_dslx_type_definition_get_colon_ref(
1407        type_definition: *const CDslxTypeDefinition,
1408    ) -> *mut CDslxColonRef;
1409    pub fn xls_dslx_type_definition_get_type_alias(
1410        type_definition: *const CDslxTypeDefinition,
1411    ) -> *mut CDslxTypeAlias;
1412
1413    // -- TypeRefTypeAnnotation
1414
1415    pub fn xls_dslx_type_ref_type_annotation_get_type_ref(
1416        type_ref_type_annotation: *const CDslxTypeRefTypeAnnotation,
1417    ) -> *mut CDslxTypeRef;
1418
1419    // -- StructDef
1420
1421    pub fn xls_dslx_struct_def_get_identifier(
1422        struct_def: *const CDslxStructDef,
1423    ) -> *mut std::os::raw::c_char;
1424
1425    pub fn xls_dslx_struct_def_is_parametric(struct_def: *const CDslxStructDef) -> bool;
1426
1427    pub fn xls_dslx_struct_def_get_member_count(struct_def: *const CDslxStructDef) -> i64;
1428
1429    pub fn xls_dslx_struct_def_get_member(
1430        struct_def: *const CDslxStructDef,
1431        i: i64,
1432    ) -> *mut CDslxStructMember;
1433
1434    pub fn xls_dslx_struct_member_get_name(
1435        member: *const CDslxStructMember,
1436    ) -> *mut std::os::raw::c_char;
1437
1438    pub fn xls_dslx_struct_member_get_type(
1439        member: *const CDslxStructMember,
1440    ) -> *mut CDslxTypeAnnotation;
1441
1442    // -- EnumDef
1443
1444    pub fn xls_dslx_enum_def_get_identifier(
1445        enum_def: *const CDslxEnumDef,
1446    ) -> *mut std::os::raw::c_char;
1447
1448    pub fn xls_dslx_enum_def_get_member_count(enum_def: *const CDslxEnumDef) -> i64;
1449
1450    pub fn xls_dslx_enum_def_get_member(
1451        enum_def: *const CDslxEnumDef,
1452        i: i64,
1453    ) -> *mut CDslxEnumMember;
1454
1455    pub fn xls_dslx_enum_def_get_underlying(
1456        enum_def: *const CDslxEnumDef,
1457    ) -> *mut CDslxTypeAnnotation;
1458
1459    pub fn xls_dslx_enum_member_get_name(
1460        member: *const CDslxEnumMember,
1461    ) -> *mut std::os::raw::c_char;
1462
1463    pub fn xls_dslx_enum_member_get_value(member: *const CDslxEnumMember) -> *mut CDslxExpr;
1464
1465    pub fn xls_dslx_expr_get_owner_module(expr: *mut CDslxExpr) -> *mut CDslxModule;
1466
1467    // --
1468
1469    pub fn xls_dslx_interp_value_free(value: *mut CDslxInterpValue);
1470
1471    pub fn xls_dslx_interp_value_to_string(
1472        value: *mut CDslxInterpValue,
1473    ) -> *mut std::os::raw::c_char;
1474
1475    pub fn xls_dslx_interp_value_clone(value: *const CDslxInterpValue) -> *mut CDslxInterpValue;
1476
1477    // Parametric env construction and InterpValue helpers
1478    pub fn xls_dslx_parametric_env_create(
1479        items: *const XlsDslxParametricEnvItem,
1480        items_count: libc::size_t,
1481        error_out: *mut *mut std::os::raw::c_char,
1482        env_out: *mut *mut CDslxParametricEnv,
1483    ) -> bool;
1484    pub fn xls_dslx_parametric_env_free(env: *mut CDslxParametricEnv);
1485    pub fn xls_dslx_parametric_env_clone(env: *const CDslxParametricEnv)
1486        -> *mut CDslxParametricEnv;
1487    pub fn xls_dslx_parametric_env_equals(
1488        lhs: *const CDslxParametricEnv,
1489        rhs: *const CDslxParametricEnv,
1490    ) -> bool;
1491    pub fn xls_dslx_parametric_env_less_than(
1492        lhs: *const CDslxParametricEnv,
1493        rhs: *const CDslxParametricEnv,
1494    ) -> bool;
1495    pub fn xls_dslx_parametric_env_hash(env: *const CDslxParametricEnv) -> u64;
1496    pub fn xls_dslx_parametric_env_to_string(
1497        env: *const CDslxParametricEnv,
1498    ) -> *mut std::os::raw::c_char;
1499    pub fn xls_dslx_parametric_env_get_binding_count(env: *const CDslxParametricEnv) -> i64;
1500    pub fn xls_dslx_parametric_env_get_binding_identifier(
1501        env: *const CDslxParametricEnv,
1502        index: i64,
1503    ) -> *const std::os::raw::c_char;
1504    pub fn xls_dslx_parametric_env_get_binding_value(
1505        env: *const CDslxParametricEnv,
1506        index: i64,
1507    ) -> *mut CDslxInterpValue;
1508
1509    pub fn xls_dslx_interp_value_make_ubits(bit_count: i64, value: u64) -> *mut CDslxInterpValue;
1510    pub fn xls_dslx_interp_value_make_sbits(bit_count: i64, value: i64) -> *mut CDslxInterpValue;
1511    pub fn xls_dslx_interp_value_make_enum(
1512        def: *mut CDslxEnumDef,
1513        is_signed: bool,
1514        bits: *const CIrBits,
1515        error_out: *mut *mut std::os::raw::c_char,
1516        result_out: *mut *mut CDslxInterpValue,
1517    ) -> bool;
1518    pub fn xls_dslx_interp_value_make_tuple(
1519        element_count: libc::size_t,
1520        elements: *mut *mut CDslxInterpValue,
1521        error_out: *mut *mut std::os::raw::c_char,
1522        result_out: *mut *mut CDslxInterpValue,
1523    ) -> bool;
1524    pub fn xls_dslx_interp_value_make_array(
1525        element_count: libc::size_t,
1526        elements: *mut *mut CDslxInterpValue,
1527        error_out: *mut *mut std::os::raw::c_char,
1528        result_out: *mut *mut CDslxInterpValue,
1529    ) -> bool;
1530
1531    pub fn xls_dslx_interp_value_from_string(
1532        text: *const std::os::raw::c_char,
1533        dslx_stdlib_path: *const std::os::raw::c_char,
1534        error_out: *mut *mut std::os::raw::c_char,
1535        result_out: *mut *mut CDslxInterpValue,
1536    ) -> bool;
1537
1538    pub fn xls_dslx_interp_value_convert_to_ir(
1539        value: *const CDslxInterpValue,
1540        error_out: *mut *mut std::os::raw::c_char,
1541        result_out: *mut *mut CIrValue,
1542    ) -> bool;
1543
1544    pub fn xls_dslx_type_to_string(
1545        type_: *const CDslxType,
1546        error_out: *mut *mut std::os::raw::c_char,
1547        result_out: *mut *mut std::os::raw::c_char,
1548    ) -> bool;
1549
1550    // Stringification for DSLX AST nodes
1551    pub fn xls_dslx_function_to_string(function: *const CDslxFunction)
1552        -> *mut std::os::raw::c_char;
1553    pub fn xls_dslx_struct_def_to_string(
1554        struct_def: *const CDslxStructDef,
1555    ) -> *mut std::os::raw::c_char;
1556    pub fn xls_dslx_enum_def_to_string(enum_def: *const CDslxEnumDef) -> *mut std::os::raw::c_char;
1557    pub fn xls_dslx_type_alias_to_string(
1558        type_alias: *const CDslxTypeAlias,
1559    ) -> *mut std::os::raw::c_char;
1560    pub fn xls_dslx_constant_def_to_string(
1561        constant_def: *const CDslxConstantDef,
1562    ) -> *mut std::os::raw::c_char;
1563    pub fn xls_dslx_quickcheck_to_string(qc: *const CDslxQuickcheck) -> *mut std::os::raw::c_char;
1564
1565    pub fn xls_dslx_type_info_get_const_expr(
1566        type_info: *mut CDslxTypeInfo,
1567        expr: *mut CDslxExpr,
1568        error_out: *mut *mut std::os::raw::c_char,
1569        result_out: *mut *mut CDslxInterpValue,
1570    ) -> bool;
1571
1572    pub fn xls_dslx_type_get_total_bit_count(
1573        type_: *const CDslxType,
1574        error_out: *mut *mut std::os::raw::c_char,
1575        result_out: *mut i64,
1576    ) -> bool;
1577
1578    pub fn xls_dslx_type_is_signed_bits(
1579        type_: *const CDslxType,
1580        error_out: *mut *mut std::os::raw::c_char,
1581        result_out: *mut bool,
1582    ) -> bool;
1583
1584    pub fn xls_dslx_type_is_bits_like(
1585        type_: *const CDslxType,
1586        is_signed: *mut *mut CDslxTypeDim,
1587        size: *mut *mut CDslxTypeDim,
1588    ) -> bool;
1589
1590    pub fn xls_dslx_type_is_enum(type_: *const CDslxType) -> bool;
1591    pub fn xls_dslx_type_is_struct(type_: *const CDslxType) -> bool;
1592    pub fn xls_dslx_type_is_array(type_: *const CDslxType) -> bool;
1593
1594    pub fn xls_dslx_type_dim_is_parametric(dim: *const CDslxTypeDim) -> bool;
1595    pub fn xls_dslx_type_dim_get_as_bool(
1596        dim: *const CDslxTypeDim,
1597        error_out: *mut *mut std::os::raw::c_char,
1598        result_out: *mut bool,
1599    ) -> bool;
1600    pub fn xls_dslx_type_dim_get_as_int64(
1601        dim: *const CDslxTypeDim,
1602        error_out: *mut *mut std::os::raw::c_char,
1603        result_out: *mut i64,
1604    ) -> bool;
1605    pub fn xls_dslx_type_dim_free(dim: *mut CDslxTypeDim);
1606
1607    pub fn xls_dslx_type_get_enum_def(ty: *const CDslxType) -> *mut CDslxEnumDef;
1608
1609    pub fn xls_dslx_type_get_struct_def(ty: *const CDslxType) -> *mut CDslxStructDef;
1610
1611    pub fn xls_dslx_type_array_get_element_type(ty: *const CDslxType) -> *mut CDslxType;
1612    pub fn xls_dslx_type_array_get_size(ty: *const CDslxType) -> *mut CDslxTypeDim;
1613
1614    // -- IR builder APIs
1615
1616    pub fn xls_package_create(name: *const std::os::raw::c_char) -> *mut CIrPackage;
1617    pub fn xls_package_get_bits_type(package: *mut CIrPackage, bit_count: i64) -> *mut CIrType;
1618
1619    pub fn xls_package_get_tuple_type(
1620        package: *mut CIrPackage,
1621        members: *mut *mut CIrType,
1622        member_count: i64,
1623    ) -> *mut CIrType;
1624
1625    pub fn xls_package_get_array_type(
1626        package: *mut CIrPackage,
1627        element_type: *mut CIrType,
1628        size: i64,
1629    ) -> *mut CIrType;
1630
1631    pub fn xls_package_get_token_type(package: *mut CIrPackage) -> *mut CIrType;
1632
1633    pub fn xls_function_builder_create(
1634        name: *const std::os::raw::c_char,
1635        package: *mut CIrPackage,
1636        should_verify: bool,
1637    ) -> *mut CIrFunctionBuilder;
1638    pub fn xls_function_builder_as_builder_base(
1639        builder: *mut CIrFunctionBuilder,
1640    ) -> *mut CIrBuilderBase;
1641    pub fn xls_function_builder_free(builder: *mut CIrFunctionBuilder);
1642    pub fn xls_bvalue_free(bvalue: *mut CIrBValue);
1643    pub fn xls_function_builder_add_parameter(
1644        builder: *mut CIrFunctionBuilder,
1645        name: *const std::os::raw::c_char,
1646        type_: *mut CIrType,
1647    ) -> *mut CIrBValue;
1648    pub fn xls_function_builder_build(
1649        builder: *mut CIrFunctionBuilder,
1650        error_out: *mut *mut std::os::raw::c_char,
1651        function_out: *mut *mut CIrFunction,
1652    ) -> bool;
1653    pub fn xls_function_builder_build_with_return_value(
1654        builder: *mut CIrFunctionBuilder,
1655        return_value: *mut CIrBValue,
1656        error_out: *mut *mut std::os::raw::c_char,
1657        function_out: *mut *mut CIrFunction,
1658    ) -> bool;
1659    pub fn xls_builder_base_add_and(
1660        builder: *mut CIrBuilderBase,
1661        lhs: *mut CIrBValue,
1662        rhs: *mut CIrBValue,
1663        name: *const std::os::raw::c_char,
1664    ) -> *mut CIrBValue;
1665    pub fn xls_builder_base_add_nand(
1666        builder: *mut CIrBuilderBase,
1667        lhs: *mut CIrBValue,
1668        rhs: *mut CIrBValue,
1669        name: *const std::os::raw::c_char,
1670    ) -> *mut CIrBValue;
1671    pub fn xls_builder_base_add_or(
1672        builder: *mut CIrBuilderBase,
1673        lhs: *mut CIrBValue,
1674        rhs: *mut CIrBValue,
1675        name: *const std::os::raw::c_char,
1676    ) -> *mut CIrBValue;
1677    pub fn xls_builder_base_add_xor(
1678        builder: *mut CIrBuilderBase,
1679        lhs: *mut CIrBValue,
1680        rhs: *mut CIrBValue,
1681        name: *const std::os::raw::c_char,
1682    ) -> *mut CIrBValue;
1683    pub fn xls_builder_base_add_not(
1684        builder: *mut CIrBuilderBase,
1685        value: *mut CIrBValue,
1686        name: *const std::os::raw::c_char,
1687    ) -> *mut CIrBValue;
1688    pub fn xls_builder_base_add_negate(
1689        builder: *mut CIrBuilderBase,
1690        value: *mut CIrBValue,
1691        name: *const std::os::raw::c_char,
1692    ) -> *mut CIrBValue;
1693    pub fn xls_builder_base_add_reverse(
1694        builder: *mut CIrBuilderBase,
1695        value: *mut CIrBValue,
1696        name: *const std::os::raw::c_char,
1697    ) -> *mut CIrBValue;
1698    pub fn xls_builder_base_add_or_reduce(
1699        builder: *mut CIrBuilderBase,
1700        value: *mut CIrBValue,
1701        name: *const std::os::raw::c_char,
1702    ) -> *mut CIrBValue;
1703    pub fn xls_builder_base_add_and_reduce(
1704        builder: *mut CIrBuilderBase,
1705        value: *mut CIrBValue,
1706        name: *const std::os::raw::c_char,
1707    ) -> *mut CIrBValue;
1708    pub fn xls_builder_base_add_xor_reduce(
1709        builder: *mut CIrBuilderBase,
1710        value: *mut CIrBValue,
1711        name: *const std::os::raw::c_char,
1712    ) -> *mut CIrBValue;
1713    pub fn xls_builder_base_add_literal(
1714        builder: *mut CIrBuilderBase,
1715        value: *mut CIrValue,
1716        name: *const std::os::raw::c_char,
1717    ) -> *mut CIrBValue;
1718    pub fn xls_builder_base_add_tuple(
1719        builder: *mut CIrBuilderBase,
1720        operands: *mut *mut CIrBValue,
1721        operand_count: i64,
1722        name: *const std::os::raw::c_char,
1723    ) -> *mut CIrBValue;
1724    pub fn xls_builder_base_add_tuple_index(
1725        builder: *mut CIrBuilderBase,
1726        tuple: *mut CIrBValue,
1727        index: i64,
1728        name: *const std::os::raw::c_char,
1729    ) -> *mut CIrBValue;
1730    pub fn xls_builder_base_add_array(
1731        builder: *mut CIrBuilderBase,
1732        element_type: *mut CIrType,
1733        elements: *const *mut CIrBValue,
1734        element_count: i64,
1735        name: *const std::os::raw::c_char,
1736    ) -> *mut CIrBValue;
1737    pub fn xls_builder_base_add_array_index(
1738        builder: *mut CIrBuilderBase,
1739        array: *mut CIrBValue,
1740        indices: *const *mut CIrBValue,
1741        index_count: i64,
1742        assumed_in_bounds: bool,
1743        name: *const std::os::raw::c_char,
1744    ) -> *mut CIrBValue;
1745    pub fn xls_builder_base_add_dynamic_bit_slice(
1746        builder: *mut CIrBuilderBase,
1747        value: *mut CIrBValue,
1748        start: *mut CIrBValue,
1749        width: i64,
1750        name: *const std::os::raw::c_char,
1751    ) -> *mut CIrBValue;
1752    pub fn xls_builder_base_add_bit_slice(
1753        builder: *mut CIrBuilderBase,
1754        value: *mut CIrBValue,
1755        start: i64,
1756        width: i64,
1757        name: *const std::os::raw::c_char,
1758    ) -> *mut CIrBValue;
1759    pub fn xls_builder_base_add_bit_slice_update(
1760        builder: *mut CIrBuilderBase,
1761        value: *mut CIrBValue,
1762        start: *mut CIrBValue,
1763        update: *mut CIrBValue,
1764        name: *const std::os::raw::c_char,
1765    ) -> *mut CIrBValue;
1766    pub fn xls_builder_base_add_concat(
1767        builder: *mut CIrBuilderBase,
1768        values: *const *mut CIrBValue,
1769        value_count: i64,
1770        name: *const std::os::raw::c_char,
1771    ) -> *mut CIrBValue;
1772    pub fn xls_builder_base_add_after_all(
1773        builder: *mut CIrBuilderBase,
1774        dependencies: *mut *mut CIrBValue,
1775        dependency_count: i64,
1776        name: *const std::os::raw::c_char,
1777    ) -> *mut CIrBValue;
1778    pub fn xls_builder_base_add_add(
1779        builder: *mut CIrBuilderBase,
1780        lhs: *mut CIrBValue,
1781        rhs: *mut CIrBValue,
1782        name: *const std::os::raw::c_char,
1783    ) -> *mut CIrBValue;
1784    pub fn xls_builder_base_add_sub(
1785        builder: *mut CIrBuilderBase,
1786        lhs: *mut CIrBValue,
1787        rhs: *mut CIrBValue,
1788        name: *const std::os::raw::c_char,
1789    ) -> *mut CIrBValue;
1790    pub fn xls_builder_base_add_umul(
1791        builder: *mut CIrBuilderBase,
1792        lhs: *mut CIrBValue,
1793        rhs: *mut CIrBValue,
1794        name: *const std::os::raw::c_char,
1795    ) -> *mut CIrBValue;
1796    pub fn xls_builder_base_add_smul(
1797        builder: *mut CIrBuilderBase,
1798        lhs: *mut CIrBValue,
1799        rhs: *mut CIrBValue,
1800        name: *const std::os::raw::c_char,
1801    ) -> *mut CIrBValue;
1802    pub fn xls_builder_base_add_umulp(
1803        builder: *mut CIrBuilderBase,
1804        lhs: *mut CIrBValue,
1805        rhs: *mut CIrBValue,
1806        name: *const std::os::raw::c_char,
1807    ) -> *mut CIrBValue;
1808    pub fn xls_builder_base_add_smulp(
1809        builder: *mut CIrBuilderBase,
1810        lhs: *mut CIrBValue,
1811        rhs: *mut CIrBValue,
1812        name: *const std::os::raw::c_char,
1813    ) -> *mut CIrBValue;
1814    pub fn xls_builder_base_add_udiv(
1815        builder: *mut CIrBuilderBase,
1816        lhs: *mut CIrBValue,
1817        rhs: *mut CIrBValue,
1818        name: *const std::os::raw::c_char,
1819    ) -> *mut CIrBValue;
1820    pub fn xls_builder_base_add_sdiv(
1821        builder: *mut CIrBuilderBase,
1822        lhs: *mut CIrBValue,
1823        rhs: *mut CIrBValue,
1824        name: *const std::os::raw::c_char,
1825    ) -> *mut CIrBValue;
1826    pub fn xls_builder_base_add_umod(
1827        builder: *mut CIrBuilderBase,
1828        lhs: *mut CIrBValue,
1829        rhs: *mut CIrBValue,
1830        name: *const std::os::raw::c_char,
1831    ) -> *mut CIrBValue;
1832    pub fn xls_builder_base_add_smod(
1833        builder: *mut CIrBuilderBase,
1834        lhs: *mut CIrBValue,
1835        rhs: *mut CIrBValue,
1836        name: *const std::os::raw::c_char,
1837    ) -> *mut CIrBValue;
1838    pub fn xls_builder_base_add_eq(
1839        builder: *mut CIrBuilderBase,
1840        lhs: *mut CIrBValue,
1841        rhs: *mut CIrBValue,
1842        name: *const std::os::raw::c_char,
1843    ) -> *mut CIrBValue;
1844    pub fn xls_builder_base_add_ne(
1845        builder: *mut CIrBuilderBase,
1846        lhs: *mut CIrBValue,
1847        rhs: *mut CIrBValue,
1848        name: *const std::os::raw::c_char,
1849    ) -> *mut CIrBValue;
1850
1851    // -- comparisons
1852    pub fn xls_builder_base_add_ule(
1853        builder: *mut CIrBuilderBase,
1854        lhs: *mut CIrBValue,
1855        rhs: *mut CIrBValue,
1856        name: *const std::os::raw::c_char,
1857    ) -> *mut CIrBValue;
1858    pub fn xls_builder_base_add_ult(
1859        builder: *mut CIrBuilderBase,
1860        lhs: *mut CIrBValue,
1861        rhs: *mut CIrBValue,
1862        name: *const std::os::raw::c_char,
1863    ) -> *mut CIrBValue;
1864    pub fn xls_builder_base_add_uge(
1865        builder: *mut CIrBuilderBase,
1866        lhs: *mut CIrBValue,
1867        rhs: *mut CIrBValue,
1868        name: *const std::os::raw::c_char,
1869    ) -> *mut CIrBValue;
1870    pub fn xls_builder_base_add_ugt(
1871        builder: *mut CIrBuilderBase,
1872        lhs: *mut CIrBValue,
1873        rhs: *mut CIrBValue,
1874        name: *const std::os::raw::c_char,
1875    ) -> *mut CIrBValue;
1876    pub fn xls_builder_base_add_sle(
1877        builder: *mut CIrBuilderBase,
1878        lhs: *mut CIrBValue,
1879        rhs: *mut CIrBValue,
1880        name: *const std::os::raw::c_char,
1881    ) -> *mut CIrBValue;
1882    pub fn xls_builder_base_add_slt(
1883        builder: *mut CIrBuilderBase,
1884        lhs: *mut CIrBValue,
1885        rhs: *mut CIrBValue,
1886        name: *const std::os::raw::c_char,
1887    ) -> *mut CIrBValue;
1888    pub fn xls_builder_base_add_sgt(
1889        builder: *mut CIrBuilderBase,
1890        lhs: *mut CIrBValue,
1891        rhs: *mut CIrBValue,
1892        name: *const std::os::raw::c_char,
1893    ) -> *mut CIrBValue;
1894    pub fn xls_builder_base_add_sge(
1895        builder: *mut CIrBuilderBase,
1896        lhs: *mut CIrBValue,
1897        rhs: *mut CIrBValue,
1898        name: *const std::os::raw::c_char,
1899    ) -> *mut CIrBValue;
1900
1901    pub fn xls_builder_base_add_shra(
1902        builder: *mut CIrBuilderBase,
1903        a: *mut CIrBValue,
1904        b: *mut CIrBValue,
1905        name: *const std::os::raw::c_char,
1906    ) -> *mut CIrBValue;
1907    pub fn xls_builder_base_add_shrl(
1908        builder: *mut CIrBuilderBase,
1909        a: *mut CIrBValue,
1910        b: *mut CIrBValue,
1911        name: *const std::os::raw::c_char,
1912    ) -> *mut CIrBValue;
1913    pub fn xls_builder_base_add_shll(
1914        builder: *mut CIrBuilderBase,
1915        a: *mut CIrBValue,
1916        b: *mut CIrBValue,
1917        name: *const std::os::raw::c_char,
1918    ) -> *mut CIrBValue;
1919    pub fn xls_builder_base_add_nor(
1920        builder: *mut CIrBuilderBase,
1921        a: *mut CIrBValue,
1922        b: *mut CIrBValue,
1923        name: *const std::os::raw::c_char,
1924    ) -> *mut CIrBValue;
1925    pub fn xls_builder_base_add_clz(
1926        builder: *mut CIrBuilderBase,
1927        a: *mut CIrBValue,
1928        name: *const std::os::raw::c_char,
1929    ) -> *mut CIrBValue;
1930    pub fn xls_builder_base_add_ctz(
1931        builder: *mut CIrBuilderBase,
1932        a: *mut CIrBValue,
1933        name: *const std::os::raw::c_char,
1934    ) -> *mut CIrBValue;
1935    pub fn xls_builder_base_add_encode(
1936        builder: *mut CIrBuilderBase,
1937        a: *mut CIrBValue,
1938        name: *const std::os::raw::c_char,
1939    ) -> *mut CIrBValue;
1940
1941    pub fn xls_builder_base_add_decode(
1942        builder: *mut CIrBuilderBase,
1943        a: *mut CIrBValue,
1944        width: *mut i64,
1945        name: *const std::os::raw::c_char,
1946    ) -> *mut CIrBValue;
1947    pub fn xls_builder_base_add_select(
1948        builder: *mut CIrBuilderBase,
1949        selector: *mut CIrBValue,
1950        cases: *const *mut CIrBValue,
1951        case_count: i64,
1952        default_value: *mut CIrBValue,
1953        name: *const std::os::raw::c_char,
1954    ) -> *mut CIrBValue;
1955    pub fn xls_builder_base_add_array_concat(
1956        builder: *mut CIrBuilderBase,
1957        arrays: *const *mut CIrBValue,
1958        array_count: i64,
1959        name: *const std::os::raw::c_char,
1960    ) -> *mut CIrBValue;
1961    pub fn xls_builder_base_add_array_slice(
1962        builder: *mut CIrBuilderBase,
1963        array: *mut CIrBValue,
1964        start: *mut CIrBValue,
1965        width: i64,
1966        name: *const std::os::raw::c_char,
1967    ) -> *mut CIrBValue;
1968    pub fn xls_builder_base_add_array_update(
1969        builder: *mut CIrBuilderBase,
1970        array: *mut CIrBValue,
1971        update_value: *mut CIrBValue,
1972        indices: *const *mut CIrBValue,
1973        index_count: i64,
1974        assumed_in_bounds: bool,
1975        name: *const std::os::raw::c_char,
1976    ) -> *mut CIrBValue;
1977    pub fn xls_builder_base_add_identity(
1978        builder: *mut CIrBuilderBase,
1979        value: *mut CIrBValue,
1980        name: *const std::os::raw::c_char,
1981    ) -> *mut CIrBValue;
1982
1983    pub fn xls_builder_base_add_sign_extend(
1984        builder: *mut CIrBuilderBase,
1985        value: *mut CIrBValue,
1986        new_bit_count: i64,
1987        name: *const std::os::raw::c_char,
1988    ) -> *mut CIrBValue;
1989    pub fn xls_builder_base_add_zero_extend(
1990        builder: *mut CIrBuilderBase,
1991        value: *mut CIrBValue,
1992        new_bit_count: i64,
1993        name: *const std::os::raw::c_char,
1994    ) -> *mut CIrBValue;
1995
1996    pub fn xls_builder_base_add_one_hot(
1997        builder: *mut CIrBuilderBase,
1998        input: *mut CIrBValue,
1999        lsb_is_priority: bool,
2000        name: *const std::os::raw::c_char,
2001    ) -> *mut CIrBValue;
2002
2003    pub fn xls_builder_base_add_one_hot_select(
2004        builder: *mut CIrBuilderBase,
2005        selector: *mut CIrBValue,
2006        cases: *const *mut CIrBValue,
2007        case_count: i64,
2008        name: *const std::os::raw::c_char,
2009    ) -> *mut CIrBValue;
2010
2011    pub fn xls_builder_base_add_priority_select(
2012        builder: *mut CIrBuilderBase,
2013        selector: *mut CIrBValue,
2014        cases: *const *mut CIrBValue,
2015        case_count: i64,
2016        default_value: *mut CIrBValue,
2017        name: *const std::os::raw::c_char,
2018    ) -> *mut CIrBValue;
2019
2020    pub fn xls_builder_base_get_last_value(
2021        builder: *mut CIrBuilderBase,
2022        error_out: *mut *mut std::os::raw::c_char,
2023        value_out: *mut *mut CIrBValue,
2024    ) -> bool;
2025
2026    pub fn xls_builder_base_get_type(
2027        builder: *mut CIrBuilderBase,
2028        value: *mut CIrBValue,
2029    ) -> *mut CIrType;
2030
2031    // New functions for sequential logic
2032    pub fn xls_vast_verilog_module_add_always_ff(
2033        m: *mut CVastModule,
2034        sensitivity_list_elements: *mut *mut CVastExpression,
2035        sensitivity_list_count: usize,
2036        out_always_ff: *mut *mut CVastAlwaysBase,
2037        error_out: *mut *mut ::std::os::raw::c_char,
2038    ) -> bool;
2039    pub fn xls_vast_verilog_module_add_always_at(
2040        m: *mut CVastModule,
2041        sensitivity_list_elements: *mut *mut CVastExpression,
2042        sensitivity_list_count: usize,
2043        out_always_at: *mut *mut CVastAlwaysBase,
2044        error_out: *mut *mut ::std::os::raw::c_char,
2045    ) -> bool;
2046    pub fn xls_vast_verilog_module_add_always_comb(
2047        m: *mut CVastModule,
2048        out_always_comb: *mut *mut CVastAlwaysBase,
2049        error_out: *mut *mut ::std::os::raw::c_char,
2050    ) -> bool;
2051    pub fn xls_vast_verilog_module_add_reg(
2052        m: *mut CVastModule,
2053        name: *const ::std::os::raw::c_char,
2054        type_: *mut CVastDataType,
2055        out_reg_ref: *mut *mut CVastLogicRef,
2056        error_out: *mut *mut ::std::os::raw::c_char,
2057    ) -> bool;
2058    pub fn xls_vast_verilog_module_add_logic(
2059        m: *mut CVastModule,
2060        name: *const std::os::raw::c_char,
2061        type_: *mut CVastDataType,
2062        out_logic_ref: *mut *mut CVastLogicRef,
2063        error_out: *mut *mut std::os::raw::c_char,
2064    ) -> bool;
2065    pub fn xls_vast_verilog_file_make_pos_edge(
2066        f: *mut CVastFile,
2067        signal_expr: *mut CVastExpression,
2068    ) -> *mut CVastExpression;
2069    pub fn xls_vast_verilog_file_make_nonblocking_assignment(
2070        f: *mut CVastFile,
2071        lhs: *mut CVastExpression,
2072        rhs: *mut CVastExpression,
2073    ) -> *mut CVastStatement;
2074    pub fn xls_vast_verilog_file_make_blocking_assignment(
2075        f: *mut CVastFile,
2076        lhs: *mut CVastExpression,
2077        rhs: *mut CVastExpression,
2078    ) -> *mut CVastStatement;
2079
2080    pub fn xls_vast_always_base_get_statement_block(
2081        always_base: *mut CVastAlwaysBase,
2082    ) -> *mut CVastStatementBlock;
2083
2084    pub fn xls_vast_statement_block_add_nonblocking_assignment(
2085        block: *mut CVastStatementBlock,
2086        lhs: *mut CVastExpression,
2087        rhs: *mut CVastExpression,
2088    ) -> *mut CVastStatement;
2089    pub fn xls_vast_statement_block_add_blocking_assignment(
2090        block: *mut CVastStatementBlock,
2091        lhs: *mut CVastExpression,
2092        rhs: *mut CVastExpression,
2093    ) -> *mut CVastStatement;
2094
2095    pub fn xls_vast_statement_block_add_comment_text(
2096        block: *mut CVastStatementBlock,
2097        text: *const std::os::raw::c_char,
2098    ) -> *mut CVastStatement;
2099
2100    pub fn xls_vast_statement_block_add_blank_line(
2101        block: *mut CVastStatementBlock,
2102    ) -> *mut CVastStatement;
2103
2104    pub fn xls_vast_statement_block_add_inline_text(
2105        block: *mut CVastStatementBlock,
2106        text: *const std::os::raw::c_char,
2107    ) -> *mut CVastStatement;
2108    pub fn xls_vast_statement_block_add_generate_loop(
2109        block: *mut CVastStatementBlock,
2110        genvar_name: *const std::os::raw::c_char,
2111        init: *mut CVastExpression,
2112        limit: *mut CVastExpression,
2113        label: *const std::os::raw::c_char,
2114    ) -> *mut CVastGenerateLoop;
2115
2116    pub fn xls_vast_statement_block_add_continuous_assignment(
2117        block: *mut CVastStatementBlock,
2118        lhs: *mut CVastExpression,
2119        rhs: *mut CVastExpression,
2120    ) -> *mut CVastStatement;
2121
2122    // Conditional (if / else-if / else)
2123    pub fn xls_vast_statement_block_add_conditional(
2124        block: *mut CVastStatementBlock,
2125        cond: *mut CVastExpression,
2126    ) -> *mut CVastConditional;
2127    pub fn xls_vast_conditional_get_then_block(
2128        cond: *mut CVastConditional,
2129    ) -> *mut CVastStatementBlock;
2130    pub fn xls_vast_conditional_add_else_if(
2131        cond: *mut CVastConditional,
2132        expr_cond: *mut CVastExpression,
2133    ) -> *mut CVastStatementBlock;
2134    pub fn xls_vast_conditional_add_else(cond: *mut CVastConditional) -> *mut CVastStatementBlock;
2135
2136    // Case statement builders
2137    pub fn xls_vast_statement_block_add_case(
2138        block: *mut CVastStatementBlock,
2139        selector: *mut CVastExpression,
2140    ) -> *mut CVastCaseStatement;
2141    pub fn xls_vast_case_statement_add_item(
2142        case_stmt: *mut CVastCaseStatement,
2143        match_expr: *mut CVastExpression,
2144    ) -> *mut CVastStatementBlock;
2145    pub fn xls_vast_case_statement_add_default(
2146        case_stmt: *mut CVastCaseStatement,
2147    ) -> *mut CVastStatementBlock;
2148
2149    pub fn xls_vast_generate_loop_get_genvar(loop_: *mut CVastGenerateLoop) -> *mut CVastLogicRef;
2150
2151    pub fn xls_vast_generate_loop_add_statement(
2152        loop_: *mut CVastGenerateLoop,
2153        statement: *mut CVastStatement,
2154    );
2155    pub fn xls_vast_generate_loop_add_generate_loop(
2156        loop_: *mut CVastGenerateLoop,
2157        genvar_name: *const std::os::raw::c_char,
2158        init: *mut CVastExpression,
2159        limit: *mut CVastExpression,
2160        label: *const std::os::raw::c_char,
2161    ) -> *mut CVastGenerateLoop;
2162    pub fn xls_vast_generate_loop_add_always_comb(
2163        loop_: *mut CVastGenerateLoop,
2164        out_always_comb: *mut *mut CVastAlwaysBase,
2165        error_out: *mut *mut std::os::raw::c_char,
2166    ) -> bool;
2167    pub fn xls_vast_generate_loop_add_always_ff(
2168        loop_: *mut CVastGenerateLoop,
2169        sensitivity_list_elements: *mut *mut CVastExpression,
2170        sensitivity_list_count: usize,
2171        out_always_ff: *mut *mut CVastAlwaysBase,
2172        error_out: *mut *mut std::os::raw::c_char,
2173    ) -> bool;
2174    pub fn xls_vast_generate_loop_add_localparam(
2175        loop_: *mut CVastGenerateLoop,
2176        name: *const std::os::raw::c_char,
2177        rhs: *mut CVastExpression,
2178    ) -> *mut CVastLocalparamRef;
2179    pub fn xls_vast_generate_loop_add_localparam_with_def(
2180        loop_: *mut CVastGenerateLoop,
2181        def: *mut CVastDef,
2182        rhs: *mut CVastExpression,
2183    ) -> *mut CVastLocalparamRef;
2184    pub fn xls_vast_generate_loop_add_continuous_assignment(
2185        loop_: *mut CVastGenerateLoop,
2186        lhs: *mut CVastExpression,
2187        rhs: *mut CVastExpression,
2188    ) -> *mut CVastStatement;
2189    pub fn xls_vast_generate_loop_add_blank_line(loop_: *mut CVastGenerateLoop);
2190    pub fn xls_vast_generate_loop_add_comment(
2191        loop_: *mut CVastGenerateLoop,
2192        comment: *mut CVastComment,
2193    );
2194    pub fn xls_vast_generate_loop_add_instantiation(
2195        loop_: *mut CVastGenerateLoop,
2196        instantiation: *mut CVastInstantiation,
2197    );
2198    pub fn xls_vast_generate_loop_add_inline_verilog_statement(
2199        loop_: *mut CVastGenerateLoop,
2200        stmt: *mut CVastInlineVerilogStatement,
2201    );
2202    pub fn xls_vast_generate_loop_add_macro_statement(
2203        loop_: *mut CVastGenerateLoop,
2204        macro_ref: *mut CVastMacroRef,
2205    );
2206
2207    pub fn xls_function_type_get_param_count(fty: *mut CIrFunctionType) -> i64;
2208
2209    pub fn xls_function_type_get_param_type(
2210        fty: *mut CIrFunctionType,
2211        index: libc::size_t,
2212        error_out: *mut *mut std::os::raw::c_char,
2213        param_type_out: *mut *mut CIrType,
2214    ) -> bool;
2215
2216    pub fn xls_function_type_get_return_type(fty: *mut CIrFunctionType) -> *mut CIrType;
2217
2218    pub fn xls_function_get_param_name(
2219        function: *mut CIrFunction,
2220        index: libc::size_t,
2221        error_out: *mut *mut std::os::raw::c_char,
2222        name_out: *mut *mut std::os::raw::c_char,
2223    ) -> bool;
2224
2225    pub fn xls_dslx_module_member_get_function(
2226        member: *const CDslxModuleMember,
2227    ) -> *mut CDslxFunction;
2228    pub fn xls_dslx_function_is_parametric(function: *const CDslxFunction) -> bool;
2229    pub fn xls_dslx_function_get_identifier(
2230        function: *const CDslxFunction,
2231    ) -> *mut std::os::raw::c_char;
2232
2233    pub fn xls_dslx_function_get_param_count(function: *const CDslxFunction) -> i64;
2234    pub fn xls_dslx_function_get_param(
2235        function: *const CDslxFunction,
2236        index: i64,
2237    ) -> *mut CDslxParam;
2238    pub fn xls_dslx_param_get_name(param: *const CDslxParam) -> *mut std::os::raw::c_char;
2239    pub fn xls_dslx_param_get_type_annotation(param: *const CDslxParam)
2240        -> *mut CDslxTypeAnnotation;
2241
2242    // -- "requires implicit token?" determination for a DSLX function
2243    pub fn xls_dslx_type_info_get_requires_implicit_token(
2244        type_info: *mut CDslxTypeInfo,
2245        function: *mut CDslxFunction,
2246        error_out: *mut *mut std::os::raw::c_char,
2247        result_out: *mut bool,
2248    ) -> bool;
2249
2250    // -- Quickcheck APIs
2251    pub fn xls_dslx_module_member_get_quickcheck(
2252        member: *const CDslxModuleMember,
2253    ) -> *mut CDslxQuickcheck;
2254
2255    pub fn xls_dslx_quickcheck_get_function(qc: *const CDslxQuickcheck) -> *mut CDslxFunction;
2256
2257    /// Returns true iff the Quickcheck has the `exhaustive` test-cases
2258    /// specifier.
2259    pub fn xls_dslx_quickcheck_is_exhaustive(qc: *const CDslxQuickcheck) -> bool;
2260
2261    /// Retrieves the test-case count for the Quickcheck. Returns true and sets
2262    /// `*result_out` when the Quickcheck has a counted test-case specifier;
2263    /// returns false when the Quickcheck is marked exhaustive (in which case
2264    /// `*result_out` is not modified).
2265    pub fn xls_dslx_quickcheck_get_count(qc: *const CDslxQuickcheck, result_out: *mut i64) -> bool;
2266}
2267
2268pub const DSLX_STDLIB_PATH: &str = env!("DSLX_STDLIB_PATH");
2269
2270/// Directory containing the libxls DSO.
2271///
2272/// *** DO NOT USE THIS VARIABLE FROM WITHIN YOUR build.rs ***
2273///
2274/// You might be tempted to write the following in your build.rs:
2275///
2276/// ```ignore
2277/// // DO NOT DO THIS IN YOUR build.rs!!
2278/// let dylib_dirpath = xlsynth_sys::XLS_DSO_PATH;
2279/// // set rpath to dylib_dirpath or something.
2280/// ```
2281///
2282/// The problem is that build.rs is compiled for host, whereas if you're setting
2283/// an rpath (or something similar) you want to get the path from compiling
2284/// xlsynth_sys for *target*.  In other words, the above will break
2285/// cross-compilation.
2286///
2287/// Instead, your build.rs should get the path from an envvar which:
2288///
2289/// ```ignore
2290/// // Do this from your build.rs instead.
2291/// let dylib_path = std::env::var("DEP_XLSYNTH_DSO_PATH").unwrap();
2292/// ```
2293///
2294/// More details are available at
2295/// <https://doc.rust-lang.org/cargo/reference/build-script-examples.html#using-another-sys-crate>.
2296///
2297/// (If you use this envvar from your crate proper -- i.e. not from build.rs --
2298/// then it's perfectly fine.)
2299pub const XLS_DSO_PATH: &str = env!("XLS_DSO_PATH");
2300
2301// Add opaque types for module port and def.
2302#[repr(C)]
2303pub struct CVastModulePort {
2304    _private: [u8; 0], // Ensures the struct cannot be instantiated
2305}
2306
2307#[repr(C)]
2308pub struct CVastDef {
2309    _private: [u8; 0], // Ensures the struct cannot be instantiated
2310}
2311
2312// Direction enum for module ports.
2313pub type VastModulePortDirection = i32;
2314
2315// Constants that match the C enum definitions.
2316pub const XLS_VAST_MODULE_PORT_DIRECTION_INPUT: VastModulePortDirection = 0;
2317pub const XLS_VAST_MODULE_PORT_DIRECTION_OUTPUT: VastModulePortDirection = 1;
2318
2319extern "C" {
2320    // -- Module port inspection APIs
2321    pub fn xls_vast_verilog_module_get_ports(
2322        m: *mut CVastModule,
2323        out_count: *mut libc::size_t,
2324    ) -> *mut *mut CVastModulePort;
2325
2326    pub fn xls_vast_verilog_module_free_ports(
2327        ports: *mut *mut CVastModulePort,
2328        count: libc::size_t,
2329    );
2330
2331    pub fn xls_vast_verilog_module_port_get_direction(
2332        port: *mut CVastModulePort,
2333    ) -> VastModulePortDirection;
2334
2335    pub fn xls_vast_verilog_module_port_get_def(port: *mut CVastModulePort) -> *mut CVastDef;
2336
2337    pub fn xls_vast_def_get_name(def: *mut CVastDef) -> *mut std::os::raw::c_char;
2338
2339    pub fn xls_vast_def_get_data_type(def: *mut CVastDef) -> *mut CVastDataType;
2340}