00:10
frgo has quit [Remote host closed the connection]
00:28
frgo has joined #amaranth-lang
00:33
frgo has quit [Ping timeout: 272 seconds]
00:51
frgo has joined #amaranth-lang
00:53
frgo has quit [Remote host closed the connection]
01:12
frgo has joined #amaranth-lang
01:18
frgo has quit [Ping timeout: 252 seconds]
02:22
frgo has joined #amaranth-lang
02:27
frgo has quit [Ping timeout: 245 seconds]
02:48
Degi_ has joined #amaranth-lang
02:49
Degi has quit [Ping timeout: 248 seconds]
02:49
Degi_ is now known as Degi
03:30
frgo has joined #amaranth-lang
03:35
frgo has quit [Ping timeout: 246 seconds]
04:47
frgo has joined #amaranth-lang
04:51
frgo has quit [Read error: Connection reset by peer]
07:07
d_olex has quit [Remote host closed the connection]
07:07
d_olex has joined #amaranth-lang
12:08
Guest96 has joined #amaranth-lang
12:09
<
Guest96 >
ImportError: cannot import name 'Record' from 'amaranth.lib.data' in version 0.6
12:09
galibert[m] has joined #amaranth-lang
12:09
<
galibert[m] >
Record was marked deprecated in 0.5 and removed in 0.6
12:10
<
Guest96 >
Thanks. is there any alternative?
12:10
<
galibert[m] >
Replacement is Struct or Interface depending on what Record was used for
12:11
<
galibert[m] >
and the syntax is different (and fairly better)
12:11
<
Guest96 >
so there is interface which is compatible to systemverilog interfcae. As i have to intantiate a SV module with interface
12:12
<
galibert[m] >
Errr not Interface, I meant Signature
12:12
<
galibert[m] >
Sorry
12:14
whitequark[cis] has joined #amaranth-lang
12:14
<
whitequark[cis] >
Amaranth Signature/Interface are not directly compatible with SV interfaces
12:14
<
whitequark[cis] >
this is for several reasons but a major one is Yosys limitations
12:14
<
whitequark[cis] >
instead, they get translated to a bunch of wires
12:16
<
Guest96 >
So is there a way to attach amarnath signals to inetface of sv
12:23
<
whitequark[cis] >
yeah, you write a SV module that adapts one to the other
12:38
jorolf[m] has joined #amaranth-lang
12:38
<
jorolf[m] >
How can I wrap an existing Signal using data.Struct? Afaic the docs only mention creating a new signal?
12:39
<
whitequark[cis] >
if Foo is your data.Struct subclass, calling Foo(some_signal) should do it
12:40
<
jorolf[m] >
My IDE tells me that the first argument should be the layout? Because Struct is a subclass of View?
12:42
d_olex has quit [Ping timeout: 252 seconds]
12:42
<
whitequark[cis] >
the IDE is wrong
12:44
<
whitequark[cis] >
there is a __new__ method that passes cls as the first argument to View's constructor
12:44
<
whitequark[cis] >
the docs actually show that, albeit without emphasis
12:45
<
jorolf[m] >
I guess I'm more used to other languages were constructors are more explicit?
12:46
<
whitequark[cis] >
it's using some metaprogramming to achieve that which confuses your IDE
12:46
<
whitequark[cis] >
we could probably fix that
12:48
<
jorolf[m] >
whitequark[cis]: I was also trying to understand the source code but the metaprogramming overwhelmed me a bit
12:49
<
galibert[m] >
Sadly making the language easy to use makes the implmentation a little harder to read
13:19
Guest96 has quit [Quit: Client closed]
13:25
Guest96 has joined #amaranth-lang
13:52
Guest96 has quit [Quit: Client closed]
15:27
d_olex has joined #amaranth-lang
16:27
EndlessKnot[m] has joined #amaranth-lang
16:27
<
EndlessKnot[m] >
Hi, I'm new to amaranth. I was trying to implement arithmetic right shift by ``` m.d.comb += self.o.eq(self.a.as_signed() >> (self.b[:5].as_unsigned())) ```
16:28
<
EndlessKnot[m] >
s/```/`/, s/```/`/
16:29
<
EndlessKnot[m] >
s/`/```/, s/`/```/
16:30
<
EndlessKnot[m] >
* Hi, I'm new to amaranth. I was trying to implement arithmetic right shift by
16:30
<
EndlessKnot[m] >
` m.d.comb += self.o.eq(self.a.as_signed() >> (self.b[:5].as_unsigned())) `
16:30
<
whitequark[cis] >
i think you need three backticks
16:31
<
EndlessKnot[m] >
thanks
16:31
<
EndlessKnot[m] >
however, it gives me this: ` AssertionError: ASR failed, expected 0b11111100, got 4294967292 `
16:32
<
whitequark[cis] >
if you do {...:#b} it will format it as binary
16:32
<
EndlessKnot[m] >
LSR seems to working fine without ` .as_unsigned `
16:33
<
whitequark[cis] >
also, note that 0b11111100 != -4
16:33
<
galibert[m] >
alu.o is unsigned even if you did part of the computation as signed
16:34
<
EndlessKnot[m] >
whitequark[cis]: sure, but I'm asserting for -4
16:34
<
EndlessKnot[m] >
galibert[m]: How can I do this?
16:35
<
galibert[m] >
Catherine: can you .as_signed() in the get?
16:36
<
whitequark[cis] >
o: In(signed(32))
16:37
<
whitequark[cis] >
galibert[m]: yeah
16:37
<
whitequark[cis] >
iirc .get() accepts any Value
16:37
<
EndlessKnot[m] >
whitequark[cis]: thanks!
16:48
<
galibert[m] >
Cat: Nice
16:48
<
galibert[m] >
ok, back to Space Age :-)
19:53
frgo has joined #amaranth-lang
20:12
frgo has quit [Remote host closed the connection]
20:13
frgo has joined #amaranth-lang
20:20
<
EndlessKnot[m] >
If I want something like a RegisterFile, can I do `regs = Array([Signal(32)]*16)`?
20:21
<
whitequark[cis] >
that specific line is wrong: you'll get 16 references to the same signal
20:21
<
whitequark[cis] >
you could rewrite it as [Signal(32) for _ in range(16)] to avoid that
20:21
<
whitequark[cis] >
the other option is to use a Memory
20:21
<
whitequark[cis] >
the tradeoff between an Array and a Memory in this case is blurry, and either solution is likely going to be fine
20:22
<
EndlessKnot[m] >
Yeah this should work. Thanks!
21:04
frgo has quit [Remote host closed the connection]
22:42
Raito_Bezarius has quit [Ping timeout: 244 seconds]
22:58
Raito_Bezarius has joined #amaranth-lang
23:06
frgo has joined #amaranth-lang
23:10
frgo has quit [Ping timeout: 252 seconds]
23:35
frgo has joined #amaranth-lang
23:40
frgo has quit [Ping timeout: 255 seconds]
23:55
frgo has joined #amaranth-lang
23:59
frgo has quit [Ping timeout: 248 seconds]