Skip to main content

rohd_hierarchy 0.1.2 copy "rohd_hierarchy: ^0.1.2" to clipboard
rohd_hierarchy: ^0.1.2 copied to clipboard

Generic hierarchy data models for hardware module navigation - HierarchyNode, Port, and HierarchyService.

example/main.dart

// Copyright (C) 2026 Intel Corporation
// SPDX-License-Identifier: BSD-3-Clause
//
// main.dart
// Runnable hierarchy construction and search example.
//
// 2026 September 23
// Author: Desmond Kirkpatrick <desmond.a.kirkpatrick@intel.com>

import 'package:rohd_hierarchy/rohd_hierarchy.dart';

void main() {
  final root = HierarchyOccurrence(
    name: 'top',
    signals: [
      SignalOccurrence(name: 'clk', width: 1, direction: 'input'),
      SignalOccurrence(name: 'count', width: 8),
    ],
    children: [
      HierarchyOccurrence(
        name: 'counter',
        definition: 'Counter',
        signals: [SignalOccurrence(name: 'enable', width: 1)],
      ),
    ],
  );
  final hierarchy = BaseHierarchyAdapter.fromTree(root);
  final clockSignals = hierarchy.searchSignals('clk');

  if (clockSignals.length != 1 ||
      clockSignals.single.path.join('/') != 'top/clk') {
    throw StateError('Expected to find the top-level clock signal.');
  }
}
1
likes
160
points
2.95k
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Generic hierarchy data models for hardware module navigation - HierarchyNode, Port, and HierarchyService.

Homepage
Repository (GitHub)
View/report issues
Contributing

License

BSD-3-Clause (license)

Dependencies

collection, meta

More

Packages that depend on rohd_hierarchy