Giter Club home page Giter Club logo

bitfield's Issues

Left of Register with reg:

Please describe your system environment before submitting your Issue.
Is there any way to put a character to the left of the register, similar to "R", "I", or "J" for types of instruction. For example:

{reg:
[
{bits: 26, name: 'address'},
{bits: 6, name: 'opcode'},
],
config:{bits: 32}
}

You could put a J to the left of the register to signify a Jump instruction from the MIPS ISA.

Support creation of memory maps

Memory maps are very useful for giving an overview of a computer system. One system may have multiple maps (such as a multi-core system, an 8051-like system, or a system with multiple buses).

Memory maps are similar to reg objects turned on their side with non-uniform spacing. Other packages have abused reg-like constructs to give satisfactory memory maps (e.g. http://www.martin-demling.de/2011/06/memory-maps-in-latex-using-the-bytefield-package/).

It would be nice for Wavedrom to support generation of memory maps.

don't run test/basic.js

I would like to try this utility, but I have some troubles by running:

$ node test/basic.js 

/home/proj/2016/bitfield/test/basic.js:25
describe('basic', function () {
^
ReferenceError: describe is not defined
    at Object.<anonymous> (/home/proj/2016/bitfield/test/basic.js:25:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:935:3

the install script

npm install   

was completed successful:

$ ls -l  node_modules
chai
eslint
istanbul
jsof
mocha
onml

my system:
centOS7 x86_64

$ node -v
v0.10.42

What i'm doing wrong?
PS sorry for stupid question, I'm totaly newbie in js/node matters

Auto detect total number of bits

Hi, I've added a feature to auto-detect the number of bits by summing all in the input file.

I wasn't sure whether to use a numeric default (e.g. -1, 0), a string default ('auto') or 'undefined' so I went with the last one.

I can open a PR if you are interested.

Here is the code if you want to check
63a46c3

Change color property from Hsl to Hex

Change the color property from Hsl to Hex since some svg to pdf converters doesn't support Hsl format, i.e. CairoSVG.

The change should match the one from wavedrompy, and the argument is the same.

Change from

const colors = { // TODO compare with WaveDrom
2: 0,
3: 80,
4: 170,
5: 45,
6: 126,
7: 215
};

const typeStyle = t => (colors[t] !== undefined)
? ';fill:hsl(' + colors[t] + ',100%,50%)'
: '';

To

const colors = { // TODO compare with WaveDrom
2: "FF0000",
3: "AAFF00",
4: "00FFD5",
5: "FFBF00",
6: "00FF1A",
7: "006AFF"
};

const typeStyle = t => (colors[t] !== undefined)
? ';fill(#' + colors[t] + ')'
: '';

integer value for attr instead of binary

Currently, there is no way to have an integer value appear in the attr section. Integer values are interpolated in binary automatically, which prevents me from displaying the number of bits in the case below. Hack is to put parentheses around the int value to force the attributes to appear as a string.

image

Save as PNG

Hi @drom, do you think there could be a way to export the resulting bitfield diagram as PNG? Thanks for the great work.

lower image border is too close to attributes

input

[
    {
        "attr": "ABCDEFGHIJKLMNPQRSTUVWXZ",
        "bits": 8
    },
    {
        "attr": "abcdefghijklmnopqrstuvwxyz",
        "bits": 8
    },
    {
        "attr": "ABCDEFGHIJKLMNPQRSTUVWXZ",
        "bits": 8
    },
    {
        "attr": "abcdefghijklmnopqrstuvwxyz",
        "bits": 8
    }
]

command

  • $ bitfield --bits 32 --lanes 2 --input bitfield.json> svg.svg
  • $ rsvg-convert svg.svg --format=png --output=png.png

result

png


I found lower image border is too close to attribute area and some characters are cut out.

Separator for long/variable length field

This is a feature/enhancement proposition.
Bit field could be used to document binary packet format if there would be a variable length separator capability. Something like this :
wavedrom_variable_length_field_proposal

declaring multiple registers in bitfield

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 ?

byte level

Hi,
Is it possible to represent a data structure at the byte level and not only bit level ? It could be a more generic protocol spec generator. I cannot find any tool on the web to do it like wavedrom . The closest tool is a latex macro :-/

compact mode attributes

@nopeslide I have updated wavedrom.com to support compact mode. #23

{reg:[
  {name: 'IPO',   bits: 8, attr: 'RO', type: 6},
  {               bits: 7},
  {name: 'BRK',   bits: 5, attr: 'RW', type: 4},
  {name: 'CPK',   bits: 1 },
  {name: 'Clear', bits: 3 },
  {bits: 8 }
], config: {lanes: 4, compact: true}}

One issue is the field attributes. (RO, RW) In example above. Do you have ideas how we can place attributes in the compact mode?

Document byte / character-based protocol in byte order using range description

You described a workaround for representing bytes using a wavedrom bitfield in #10.

I would like to document the following byte/character based protocol command structure:

Command structure:
* DT: this specific command uses 0x00

00   01 02 03 04   05 06 07 08   09   10   11   12 13 14 15   16 17   18 19   20 21 22 23   24 25   26   27 28 29 30 31
-----------------------------------------------------------------------------------------------------------------------
                                      |<------------------- CRC16 --------------------->|
15   01 23 45 67   98 76 54 32   80   00   00   65 72 06 B8   00 00   00 00   00 00 00 00   00 00   00   -- -- -- -- --
^^   ^^^^^^^^^^^   ^^^^^^^^^^^   ^^   ^^   ^^   ^^^^^^^^^^^   ^^^^^           ^^^^^^^^^^^   ^^^^^   ^^
ID   TargetAddr#   SourceAddr#   Idx  DT   ?    TimeStamp     Gap             Password      CRC16   CRC8

However the main difficulty here is that the legend of the bytes is ordered ascending,
while a common bitfield is ordered from most significant to least significant bits, ie. descending.

Are there options to reverse the order, e.g. bytes 00 .. 31 for a byte based protocol instead of bit 31 .. 00 for bitfields.
Side note: for bitfields it also might be interesting to specify big- vs little-endianness for display of a register block ?

I could workaround it by using a wavedrom signal, but I would prefer something like the register view with byte order.

image

{signal: [
  {name:'Clock',     wave: 'p...........' },
  {name:'Data',      wave: 'x345.6.78.9x', data: '7E 07 00000000 00000000 00 07 7F' },
  {name:'Description', wave: 'x345.6.78.9x', data: 'SOF ID TargetAddr# SourceAddr# 0x00 CRC8 EOF' },
  {name:'Request',   wave: '01.........0' }
],
 head:{
   text:'Messages: DTU to INV: "Init" (0x07)',
   tick:0,
   every:2
 },
 foot:{
   text:'Messages 0x07',
   tock:9
 },
}

Support memory maps

Issue moved from https://github.com/wavedrom/wavedrom/issues/257

Memory maps are conceptually similar to bitfields, except they're rotated on their sides. Memory maps may also be non-uniform in size, though that may be a future enhancement.

It may be possible to reuse the compact view (#23) to create memory maps, by setting the number of lanes to the number of memory sections (e.g. 16), and the width to 1.

Invert bit order option

If this had an option to reverse the order of the bits, it would also be useful for documenting network / file binary formats.

Longer bitfields

Is it possible to display longer registers, 64 bits, 128 bits, or even some custom number x bits?

Thank you,

attr as number

If attr property of the field is number, render as binary. Align bits to the columns.

Should we support for ?, x, z ?

allow overlapping fields

The fields may overlap.
intentional / non-intentional.
Require specification to have independent (offset, width)
Fields may go out of bounds of the register.

Document "reg"

The "reg" class is an exciting development in WaveDrom and WaveJSON. It allows for a uniform way to describe registers.

Currently, it appears largely undocumented. There is an example in the README.md, but it is missing from WaveJSON wiki, the WaveJSON schema, and the tutorial.

attr as array

If attr property of the field is Array, then render attributes under each other.

[Feature] ASCII output

Would it be possible to also add an option so that ASCII output (not image) can be set?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.