Skip to content

Commit

Permalink
start htq backend
Browse files Browse the repository at this point in the history
  • Loading branch information
rcgoodfellow committed Sep 12, 2024
1 parent bb69069 commit 0153a66
Show file tree
Hide file tree
Showing 9 changed files with 245 additions and 26 deletions.
83 changes: 60 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ members = [
"x4c",
"x4c_error_codes",
"codegen/rust",
"codegen/htq",
"lang/p4rs",
"lang/p4-macro",
"lang/p4-macro-test",
Expand Down
10 changes: 10 additions & 0 deletions codegen/htq/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "p4-htq"
version = "0.1.0"
edition = "2021"

[dependencies]
p4 = { path = "../../p4" }
#htq = { git = "https://github.com/oxidecomputer/htq", branch = "sector-001" }
htq = { path = "/Users/ry/src/htq" }
thiserror = "1.0.63"
18 changes: 18 additions & 0 deletions codegen/htq/src/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright 2024 Oxide Computer Company

use thiserror::Error;

#[derive(Error, Debug)]
pub enum CodegenError {
#[error("There is no equivalent htq type for {0}")]
NoEquivalentType(p4::ast::Type),
}

#[derive(Error, Debug)]
pub enum EmitError {
#[error("io error {0}")]
Io(#[from] std::io::Error),

#[error("codegen error {0}")]
Codegen(#[from] CodegenError),
}
Loading

0 comments on commit 0153a66

Please sign in to comment.