From ef4461bd18e008e163676acec0811f3a1a4dc463 Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Fri, 17 May 2024 00:11:04 +0200 Subject: [PATCH] added relative x coordinates --- gallery/test.pdf | Bin 22533 -> 22533 bytes gallery/test.typ | 13 +- gallery/test2.pdf | Bin 0 -> 22533 bytes gallery/test2.typ | 312 +++++++++++++++++++++++++++++++++++++++ src/elements/element.typ | 8 + 5 files changed, 326 insertions(+), 7 deletions(-) create mode 100644 gallery/test2.pdf create mode 100644 gallery/test2.typ diff --git a/gallery/test.pdf b/gallery/test.pdf index 620bc68d61ecbaf222691b06f6a15d53cd7b0df9..36b00eeafa27e96a9a2de7af8978b07b9b5f200d 100644 GIT binary patch delta 179 zcmZqOz}UKhaRYy#vZ;lMMU*C&f`Yzpeu_(CNveW|iNun}?+W?LWQbjx Pt*xel26m~*FT!O3kWM#k delta 179 zcmZqOz}UKhaRYy#vZ1MoNt7m+f`Yzpeu_(CNveW|ijE611M`x@M^JOMNun}?+W?LWQbjx Pt*xel26m~*FT!O3AQLsk diff --git a/gallery/test.typ b/gallery/test.typ index d143f40..d3fb70a 100644 --- a/gallery/test.typ +++ b/gallery/test.typ @@ -5,7 +5,7 @@ #circuit({ element.block( x: 0, y: 0, w: 1.5, h: 2.2, - id: "PC-buf", + id: "PCBuf", fill: util.colors.orange, ports: ( west: ( @@ -22,18 +22,18 @@ ) ) ) - wire.stub("PC-buf-port-CLK", "north", name: "CLK") - wire.stub("PC-buf-port-EN", "south", name: "PCWrite") + wire.stub("PCBuf-port-CLK", "north", name: "CLK") + wire.stub("PCBuf-port-EN", "south", name: "PCWrite") element.multiplexer( - x: 3, y: (from: "PC-buf-port-PC", to: "in0"), w: 1, h: 2, + x: 3, y: (from: "PCBuf-port-PC", to: "in0"), w: 1, h: 2, id: "AdrSrc-MP", fill: util.colors.orange, entries: 2 ) wire.wire( "wPCBuf-InstDataMgr", ( - "PC-buf-port-PC", + "PCBuf-port-PC", "AdrSrc-MP-port-in0" ), name: "PC", @@ -283,7 +283,7 @@ wire.wire( "wResMP-PCBuf", ( "Res-MP-port-out", - "PC-buf-port-PCNext" + "PCBuf-port-PCNext" ), style: "dodge", dodge-y: -5, @@ -294,7 +294,6 @@ bus: true ) - wire.intersection("wResMP-RegFile.dodge-end") wire.intersection("wResMP-AdrSrc.dodge-end") }) \ No newline at end of file diff --git a/gallery/test2.pdf b/gallery/test2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..53639b893bf0da5db89ea79fc72efb25e39c2c28 GIT binary patch literal 22533 zcmb5W1z1}_(*|0oK+z(_B`qy(A-F@37I&9Ikf6a`THGncp|}_K7I!TWiWMkc+}+^@ z`0SVG{`cl=a?ZOuvoo{1Gv_2Q`&L0rf(gjXh4%I%;)RCB0bm8d49(H_`OyFX78O?; zV*rZ;%-Z1&DLWcE+*jOHv)+$_Cc1#Ox4;9 z!DS5KzNLmNA!Q{2!1bi*XNz8Z2x~$Mer%R+B+Cqy|*@j0q%zZp$)`a zY#d;A0Iqwp5cOi}_e3lR$tp0(_hPaJHvb-{J4SVYHYoRBR3J!s5LY|^HbfV!01gm4fDIv-4Z*2@T*bsE=2u4-_HyaOt9e7tb5LzL` zAPVU2iu1l8^tl6E01yaa^L^o9zw7g^aNTK(U_`JZ$blfxot+3d>^umQ?ilVr9uPtl z5OgQ2C{N-{*zBs6y^fZX5s|01DM!&5aSQz-~sS(aNj%0dj|tc zGl+<_sipD58WOqlCkMpbv$5ZG@Zet#048?Udw&HR*t|0~Gle=Jru@D_8L`mS5Zy7~ zli#gS2{TJ$HUQ84;`|SvyK};S8!BULZR!980D+ubcVZsG1Q@Y!@5TnjQ0(wG-O`%nS6*9q`Xj|H&O zAxPAW?d;89*1P~90*G51fnip6%GsmcdF7oN02T#=Udjl)Ow6o}?EYa4!0=8k8p6Sh z%peZ`K=*YJE5u;jG5<#}0Xjwm+E1n`?6 zUiTsRzqKP=_TFGa69^O$?C;3g5ag_^>_EYL1bRSh4~YE%fgTXY17d$boDYcO0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)Ci}kZ=eN|!b_9pgGQ3PtgX!q%&7Xhx*P{rsgX)$i~9~7OD<=Lzc@H*10U;7gr8) z2(*5rA#N#+!Th=kRFI@Ud(Hifv1$lj5dLH@_B(>}?3PLoc0R-qBGrmY^aQLkupzV` zH9sRCDku`N^ABo (v.at(0), -3.5), mid), + (horizontal: (), vertical: (0, 3.5)), + ), + bus: true + ) + wire.wire( + "wBus-RegFile-A1", ( + "RegFile-port-A1", + (horizontal: mid, vertical: ()), + ), + name: "RS1", + name-pos: "end", + slice: (19, 15), + reverse: true, + bus: true + ) + wire.wire( + "wBus-RegFile-A3", ( + "RegFile-port-A3", + (horizontal: mid, vertical: ()), + ), + name: "RD", + name-pos: "end", + slice: (11, 7), + reverse: true, + bus: true + ) + wire.wire( + "wBus-Extender", ( + "Extender-port-in", + (horizontal: mid, vertical: ()), + ), + slice: (31, 7), + reverse: true, + bus: true + ) + + element.alu( + x: (rel: 4, to: "RegFile.east"), + y: (from: "RegFile-port-RD1", to: "in1"), + w: 1, h: 2, + id: "ALU", + fill: util.colors.purple + ) + wire.wire( + "wRegFile-ALU", ( + "RegFile-port-RD1", + "ALU-port-in1" + ), + name: ("A", "SrcA"), + bus: true + ) + + element.block( + x: (rel: 3, to: "ALU.east"), + y: (from: "ALU-port-out", to: "in"), + w: 1.5, h: 2, + id: "OutBuf", + fill: util.colors.orange, + ports: ( + west: ( + (id: "in"), + ), + north: ( + (id: "CLK", clock: true), + ), + east: ( + (id: "out"), + ) + ) + ) + wire.stub("OutBuf-port-CLK", "north", name: "CLK") + wire.wire( + "wALU-OutBuf", ( + "ALU-port-out", + "OutBuf-port-in" + ), + name: "ALUResult", + bus: true + ) + + element.multiplexer( + x: (rel: 2.5, to: "OutBuf.east"), + y: (from: "OutBuf-port-out", to: "in0"), + w: 1, h: 2.5, + id: "Res-MP", + fill: util.colors.orange, + entries: 3 + ) + wire.stub("Res-MP.north", "north", name: "ResultSrc") + wire.stub("Res-MP-port-in2", "west") + wire.wire( + "wOutBuf-ResMP", ( + "OutBuf-port-out", + "Res-MP-port-in0" + ), + name: "ALUOut", + bus: true + ) + + wire.wire( + "wExt-ALU", ( + "Extender-port-out", + "ALU-port-in2", + ), + name: ("ImmExt", "SrcB"), + bus: true, + style: "zigzag", + zigzag-ratio: 60% + ) + + wire.wire( + "wInstDataMgr-ResMP", ( + "InstDataMgr-port-RD", + "Res-MP-port-in1" + ), + style: "dodge", + dodge-y: -4, + dodge-sides: ("east", "west"), + name: "Data", + name-pos: "start", + bus: true + ) + + wire.wire( + "wResMP-AdrSrc", ( + "Res-MP-port-out", + "AdrSrc-MP-port-in1" + ), + style: "dodge", + dodge-y: -5, + dodge-sides: ("east", "west"), + dodge-margins: (0.5, 1), + bus: true + ) + + wire.wire( + "wResMP-RegFile", ( + "Res-MP-port-out", + "RegFile-port-WD3" + ), + style: "dodge", + dodge-y: -5, + dodge-sides: ("east", "west"), + dodge-margins: (0.5, 1), + bus: true + ) + + wire.wire( + "wResMP-PCBuf", ( + "Res-MP-port-out", + "PCBuf-port-PCNext" + ), + style: "dodge", + dodge-y: -5, + dodge-sides: ("east", "west"), + dodge-margins: (0.5, 1.5), + name: "PCNext", + name-pos: "end", + bus: true + ) + + wire.intersection("wResMP-RegFile.dodge-end") + wire.intersection("wResMP-AdrSrc.dodge-end") +}) \ No newline at end of file diff --git a/src/elements/element.typ b/src/elements/element.typ index 967344d..ee76a3b 100644 --- a/src/elements/element.typ +++ b/src/elements/element.typ @@ -39,12 +39,20 @@ let width = w let height = h + let x = x let y = y if x == none { panic("Parameter x must be set") } if y == none { panic("Parameter y must be set") } if w == none { panic("Parameter w must be set") } if h == none { panic("Parameter h must be set") } + if (type(x) == dictionary) { + let offset = x.rel + let to = x.to + let (ctx, to-pos) = coordinate.resolve(ctx, (rel: (offset, 0), to: to)) + x = to-pos.at(0) + } + if (type(y) == dictionary) { let from = y.from let to = y.to