Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:

- run: |
mk python-release owner=libre-embedded \
repo=ifgen version=4.6.0
repo=ifgen version=4.6.1
if: |
matrix.python-version == '3.13'
&& matrix.system == 'ubuntu-latest'
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
=====================================
generator=datazen
version=3.2.3
hash=8d3c526a8528a19206c3cbb830964859
hash=b1734afc9a17480fd92d42eb65e351f9
=====================================
-->

# ifgen ([4.6.0](https://pypi.org/project/ifgen/))
# ifgen ([4.6.1](https://pypi.org/project/ifgen/))

[![python](https://img.shields.io/pypi/pyversions/ifgen.svg)](https://pypi.org/project/ifgen/)
![Build Status](https://github.com/libre-embedded/ifgen/workflows/Python%20Package/badge.svg)
Expand Down
2 changes: 1 addition & 1 deletion config
4 changes: 2 additions & 2 deletions ifgen/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# =====================================
# generator=datazen
# version=3.2.3
# hash=1d9a445cd0a6b0e0126151d1aa677943
# hash=940874292201d38dfaaf344ff5181488
# =====================================

"""
Expand All @@ -10,4 +10,4 @@

DESCRIPTION = "An interface generator for distributed computing."
PKG_NAME = "ifgen"
VERSION = "4.6.0"
VERSION = "4.6.1"
1 change: 1 addition & 0 deletions ifgen/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def init(self, data: _JsonObject) -> None:
"stream",
"methods",
"default_endianness",
"packed",
]
struct: dict[str, Any]
for struct in data.get("structs", {}).values(): # type: ignore
Expand Down
3 changes: 3 additions & 0 deletions ifgen/data/schemas/Config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ properties:
unit_test:
type: boolean
default: true
packed:
type: boolean
default: true

# https://en.cppreference.com/w/cpp/types/endian
default_endianness:
Expand Down
2 changes: 2 additions & 0 deletions ifgen/data/schemas/Struct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ properties:
type: boolean
unit_test:
type: boolean
packed:
type: boolean
default_endianness:
type: string
enum: [little, big, native]
Expand Down
6 changes: 4 additions & 2 deletions ifgen/struct/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,10 @@ def struct_instance(
def cpp_struct_header(task: GenerateTask, writer: IndentedFileWriter) -> None:
"""Create the contents of a C++ struct header file."""

attributes = ["gnu::packed"]
writer.write(f"struct [[{', '.join(attributes)}]] {task.name}")
attributes = ["gnu::packed"] if task.instance["packed"] else None
attribute_str = f"[[{', '.join(attributes)}]]" if attributes else ""
writer.write(f"struct {attribute_str} {task.name}")

with writer.scope(suffix=";"):
writer.c_comment("Constant attributes.")
with writer.trailing_comment_lines(
Expand Down
1 change: 1 addition & 0 deletions ifgen/svd/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def generate_configs(self, path: Path, config: SvdConfig) -> None:
"codec": False,
"methods": False,
"unit_test": False,
"packed": False,
},
"enum": {"use_map": False, "identifier": False},
},
Expand Down
2 changes: 1 addition & 1 deletion local/variables/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
major: 4
minor: 6
patch: 0
patch: 1
entry: ig
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta:__legacy__"

[project]
name = "ifgen"
version = "4.6.0"
version = "4.6.1"
description = "An interface generator for distributed computing."
readme = "README.md"
requires-python = ">=3.12"
Expand Down