<sys64738>
there's probably a LaTeX package for this out there somewhere
<clever>
sys64738: i threw together a quick sample latex file, and it fails on the very first statement
<clever>
> ! Undefined control sequence.
<clever>
> l.1 \begin
<sys64738>
... have you ever used LaTeX before?
<clever>
years ago
<clever>
i cant find those old scripts
<sys64738>
yeah, thing is that documents first need to start withwhat's called a "preamble" which starts with "\documentclass[<stuff here>]{<more stuff here>}" and then a bunch of other commands
<clever>
i initially had that too
<clever>
it complained about it the same way
<sys64738>
weird
<sys64738>
what latex distribution, compiler, editor, ... are you using?
<clever>
> ! Undefined control sequence.
<clever>
> l.1 \documentclass
<clever>
> {article}
<clever>
just running pdftex on it, from the texliveFull package
<clever>
undocumented> This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022/nixos.org) (preloaded format=pdftex)
<sys64738>
ah, nixos. wouldn't be surprised if there's some weird specific way to configure it in order for it to actually work, then. (which i dont know about because i dont use nixos)
<clever>
how would it normally load the documentclass stuff?
<sys64738>
also uh wait. you're running *pdftex* on it?
<clever>
yeah
<clever>
trying to turn latex into a pdf
<sys64738>
can you uh. try *pdflatex* instead?
<clever>
now i get a pdf, with the example text
<sys64738>
ah, there you go
<clever>
ah, but pkgs.texliveMinimal lacks that binary
<sys64738>
(\documentclass and friends are from LaTeX packages, which is a bunch of TeX source code that gives you the actually useful commands to do document typesetting. pdflatex loads these packages by default, pdftex doesn't)
<clever>
texliveBasic does still have it
<clever>
ahhh
<clever>
so minimal is just tex, without la
<sys64738>
also make sure to have latexmk
<sys64738>
(the binary)
<clever>
its in the full, medium, and BookPub packages
<sys64738>
LaTeX is "fun" in the way that cross-refs, citations etc. need multiple runs to be done and rendered correctly, so the number of times to run pdflatex (and sometimes other tools like biber) varies between runsdepending on what you have and what has been added. latexmk automates this
<sys64738>
(latexmk can also put all the .aux .out .log etc crud to a separate folder)
<f_>
clever: I can prob. have the generator do the math
<sys64738>
so it might be a better idea to write the info tables in some machine-readable format, then use some other scripting language to generate LaTeX
<sys64738>
(which is what lots of people probably already do anyway)
<clever>
yeah
<clever>
that would also enable auto-generating .h files that can be consumed by the compiler
<clever>
i think it was svd, that i'm thinking of?
<clever>
the cortex-M3's are operating in a 32bit address space
<clever>
some address ranges go to the sram and rom at the top
<clever>
some go out the bottom ports, and hit a custom splitter
<clever>
0xf0000000 and 0xf0004000 (both 16k windows) then peel off and go to the right, into pio and rio
<clever>
everything else goes thru the address translator, and maps into a 40bit addr space
<clever>
so the M3 thinks uart0 is at 0x4003_0000
<clever>
but the 40bit bus, says that uart0 is at 0xc0_4003_0000
<clever>
and then linux says that uart0 is at 0x1f_0003_0000 within the arm physical space
<clever>
sys64738: how would you best represent this in svd and pdf?
<sys64738>
this depends, there's multiple options, and idk if there's a single "best" one
<clever>
the 32bit space is best if your running code on the M3
<clever>
the linux view is best if your writing linux drivers
<clever>
the 40bit space, i think linux handles automatically, via dma-ranges and device-tree
<sys64738>
for SVD, you typically want to use the autogenerated code to be used on the chip, and SVDs are typically used for microcontrollers (as opposed to device trees)
<clever>
and cortex-m3 is basically an MCU
<sys64738>
for the PDF, well, that's more of a concern about what would be the best *explanation*
<clever>
i'm thinking the svd should be from the M3's point of view, since thats where most of the auto-generated code would run?
<clever>
and then the pdf can explain the exact differences
<sys64738>
yeah
<sys64738>
you could pick one address space and then have a part of the chapter on the memory map explain the different address spaces & what convention is used in the PDF, or you could use multiple addresses everywhere
<sys64738>
or have a memory map table with all the different address spaces (down to the bus level, probably, unless you want the table to be huge), and then have tables for each bus with peripheral lists (that just use some base/offset) etc
<clever>
this shows how the various addresses map around
<clever>
could latex generate a similar image, or am i better off just going into gimp?
<sys64738>
I'd use either inkscape or LaTeX TikZ
<sys64738>
TikZ is known for being more annoying though, but inkscape could be more "fiddly" to have a result with a uniform layout
<sys64738>
but id def use inkscape instead of gimp
<sys64738>
(vector drawings just make much more sense for this)
<clever>
now to write some svd, and see what pops out of svd2latex.....
<sys64738>
errrrrrr.
<sys64738>
18:16 <sys64738> yeah. though idk if there's an svd2latex script already out there
<sys64738>
you found one?
<clever>
i just assumed it exists, lol
<clever>
i can always write one if it doesnt
<clever>
xml->latex seems simple enough
<sys64738>
yeah id just quickly hack something together in python
<clever>
even with that tool missing, svd sounds like the best option
<sys64738>
yeah probs
<clever>
any gui tools for svd viewing?
<clever>
also just to validate the syntax
<sys64738>
there's several command-line tools that can be used for checking/linting, but idk about visualizers
<clever>
so if matrix sends a file, irc gets a link, and discord gets a file (assuming it doesnt bug)
<clever>
if discord sends a file, both irc and matrix get a link
<clever>
even when its working, its not working the same way in both directions
<f_>
yeah.
<f_>
That one might be known already.
Herc has quit [Remote host closed the connection]
Herc has joined ##raspberrypi-internals
<clever>
sys64738: i think the next big question then, latex include statements?
<sys64738>
wdym? like C #include?
<clever>
yeah
<clever>
thinking i would auto-generate parts of the latex, and then #include them into the main file
<sys64738>
yeah, there's \input{filename} and \include{filename}. one is for verbatim inclusion, C-style, the other is for a more "document with subfiles" approach which also inserts page breaks and stuff. i always confuse the two
<sys64738>
i did my master's thesis with a bunch of \include{}s for the separate chapters, then \input{} whenever needed (eg source code listings in the appendix)
<clever>
how do pagebreaks behave differently between the 2?
<f_ridge>
<sys64738/Matrix> suppose you have a `main.tex`:
<f_ridge>
<sys64738/Matrix> ```tex
<f_ridge>
<sys64738/Matrix> hello
<f_ridge>
<sys64738/Matrix>
<f_ridge>
<sys64738/Matrix> \include{sub1}
<f_ridge>
<sys64738/Matrix>
<f_ridge>
<sys64738/Matrix> world
<f_ridge>
<sys64738/Matrix>
<f_ridge>
<sys64738/Matrix> \input{sub2}
<f_ridge>
<sys64738/Matrix>
<f_ridge>
<sys64738/Matrix> end of document
<f_ridge>
<sys64738/Matrix> ```
<f_ridge>
<sys64738/Matrix>
<f_ridge>
<sys64738/Matrix> `sub1.tex` says `hello from sub1`, `sub2.tex` says `hello from sub2` the final result you get is:
<f_ridge>
<sys64738/Matrix>
<f_ridge>
<sys64738/Matrix> ```
<f_ridge>
<sys64738/Matrix> hello
<f_ridge>
<sys64738/Matrix>
<f_ridge>
<sys64738/Matrix> --- new page starts here ---
<f_ridge>
<sys64738/Matrix>
<f_ridge>
<sys64738/Matrix> hello from sub1
<f_ridge>
<sys64738/Matrix>
<f_ridge>
<sys64738/Matrix> --- new page starts here ---
<f_ridge>
<sys64738/Matrix>
<f_ridge>
<sys64738/Matrix> world
<f_ridge>
<sys64738/Matrix>
<f_ridge>
<sys64738/Matrix> hello from sub2
<f_ridge>
<sys64738/Matrix>
<f_ridge>
<sys64738/Matrix> end of document
<f_ridge>
<sys64738/Matrix> ```
<sys64738>
wow that's slow on the IRC side
<f_ridge>
<cleverca22/Matrix> ah i see, so input include would force the imported file onto its own page
<f_ridge>
<cleverca22/Matrix> and thats better for chapters
<f_ridge>
<cleverca22/Matrix> while input just shoves it inline, and pagebreaks happen whenever you overflow?