Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Packet drawings, allow bit count as well as start-end #5978

Open
BryanCrotazGivEnergy opened this issue Oct 18, 2024 · 1 comment · May be fixed by #5980
Open

In Packet drawings, allow bit count as well as start-end #5978

BryanCrotazGivEnergy opened this issue Oct 18, 2024 · 1 comment · May be fixed by #5980
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request

Comments

@BryanCrotazGivEnergy
Copy link

BryanCrotazGivEnergy commented Oct 18, 2024

Proposal

Mermaid packet format insists on bit start -> bit end. This makes it very difficult to change your mind while generating a packet diagram, eg increasing one field from 16-32 bit.

As well as supporting
<s>-<e>: "name"
where s is the start bit and e is the end bit

Also support
<s>-<b>bits: "name"
<s>-1bit: "name"
where s is the start bit, b is a bit count

Short form is the most valuable
<b>bits: "name" follows on automatically from the previous bit. If this is the first field, it's assumed to start at bit 0.

Example

```mermaid
8bits: "Message Id"
16bits: "From Id"
32bits: "Command Data"
1bit: "write flag"
7bits: "reserved"
64-8bits: "new data"
```

Screenshots

No response

@BryanCrotazGivEnergy BryanCrotazGivEnergy added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request labels Oct 18, 2024
@zanedp
Copy link

zanedp commented Nov 23, 2024

I was considering using the "packet" type as a way to draw a memory map, which would be byte-scale instead of bit-scale. I wonder if a different syntax that didn't "tie" the diagram to a particular unit of measure would be more flexible? Shorting to b would make it so both "bits" and "bytes" make sense. But maybe doing something like +5 to mean it's relative to the previous thing would work and be intuitive?

+16: Header
+32: Data
+4: Footer

Using + is similar to "relative time" in PlantUML's timing diagram.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants