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

declaring multiple registers in bitfield #57

Open
sriniv1422 opened this issue Jun 2, 2023 · 4 comments
Open

declaring multiple registers in bitfield #57

sriniv1422 opened this issue Jun 2, 2023 · 4 comments
Labels

Comments

@sriniv1422
Copy link

Hello

How can I declare multiple registers using bitfield .
For eg :
{reg: [
{bits: 7, name: 'opcode', attr: 'OP-IMM'},
{bits: 5, name: 'rd', attr: 'dest'},
{bits: 3, name: 'func3', attr: ['ADDI']},
{bits: 5, name: 'rs1', attr: 'src'},
{bits: 12, name: 'imm[11:0]', attr: 'I-immediate[11:0]', type: 3}
],
}
works just fine. If I want to create another reg or a duplicate of this ; How can I do it in the editor ?

@drom drom added the question label Jul 16, 2023
@drom
Copy link
Member

drom commented Jul 16, 2023

no. it is a single diagram editor.
but you could create multi-register diagram
https://observablehq.com/@drom/risc-v-v-opcodes?collection=@drom/bitfield

@lucasbrasilino
Copy link

Hello @drom,

Naive question: how can I render:

https://observablehq.com/@drom/bitfield-testbox?collection=@drom/bitfield#cell-802

using the command line, provided I can run npx bit-field ?
Thanks!

@drom
Copy link
Member

drom commented Jan 5, 2024

@UTPALBHATT
Copy link

I want to be able to add long fiend name and I am not able to change the size. Is there any option?
This is what I have tried so far:
{reg:
[
{bits: 1, name: 'Field1-LongFieldnametobeadded', type: 1, rotate: -45},
{bits: 7, name: 'Field2', type: 1},
{bits: 4, name: 'Field3', type: 1},
{bits: 1, name: 'Field4', type: 1},
{bits: 3, name: 'Field5', type: 1},
{bits: 4, name: 'Field6', type: 1},
{bits: 4, name: 'Field7', type: 1},
{bits: 4, name: 'Field8', type: 1},
{bits: 1, name: 'Field9', type: 1},
{bits: 3, name: 'Field10', type: 1},

],
config: {
bits:32,
hflip:true,
vflip:false,
lanes:4,
compact:true,
hspace: 9,
vspace: 55,
margin:{right: 22, bottom:5, left:100, top:20},
label: {right: ['24', '16','8', '0']},
fontsize: 12,
trim:false,
offset:true,
fontfamily: "sans-serif",
fontweight: "bold",
trim:true
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants