Monday, 2025-03-03

*** tpb <[email protected]> has joined #yosys00:00
*** swiftgeek <swiftgeek!~swiftgeek@user/meow/swiftgeek> has quit IRC (*.net *.split)00:07
*** somlo <[email protected]> has quit IRC (*.net *.split)00:07
*** jn <jn!~quassel@user/jn/x-3390946> has quit IRC (*.net *.split)00:07
*** m42uko <m42uko!~m42uko@user/m42uko> has quit IRC (*.net *.split)00:07
*** jix <jix!~jix@user/jix> has quit IRC (*.net *.split)00:07
*** cyrozap <cyrozap!~cyrozap@user/cyrozap> has quit IRC (*.net *.split)00:07
*** marex <marex!~marex@user/marex> has quit IRC (*.net *.split)00:07
*** Ekho <Ekho!~Ekho@user/ekho> has quit IRC (*.net *.split)00:07
*** smkz <smkz!~x@user/smkz> has quit IRC (*.net *.split)00:07
*** dys <dys!~dys@user/dys> has quit IRC (*.net *.split)00:07
*** puddingpimp <[email protected]> has quit IRC (*.net *.split)00:07
*** lilibox <[email protected]> has quit IRC (*.net *.split)00:07
*** tcal <[email protected]> has quit IRC (*.net *.split)00:07
*** darkling <darkling!~darkling@2001-ba8-1f1-f0e6-0-0-0-2.autov6rev.bitfolk.space> has quit IRC (*.net *.split)00:07
*** Kamilion <[email protected]> has quit IRC (*.net *.split)00:07
*** tnt <tnt!~tnt@osmocom/tnt> has quit IRC (*.net *.split)00:07
*** kristianpaul <kristianpaul!~paul@user/kristianpaul> has quit IRC (*.net *.split)00:07
*** Wolfvak <Wolfvak!~Wolfvak@user/wolfvak> has quit IRC (*.net *.split)00:07
*** _catircservices <_catircservices!catircserv@2a01:4f8:c012:5b7:0:1:0:597> has quit IRC (*.net *.split)00:07
*** srk <srk!~sorki@user/srk> has quit IRC (*.net *.split)00:07
*** anuejn_ <[email protected]> has quit IRC (*.net *.split)00:07
*** vup <[email protected]> has quit IRC (*.net *.split)00:07
*** adamgreig <adamgreig!~adam@user/agg> has quit IRC (*.net *.split)00:07
*** Semisol[m] <Semisol[m]!semisolsem@2a01:4f8:c012:5b7:0:1:0:56d> has quit IRC (*.net *.split)00:07
*** Guest1880 <Guest1880!~root@user/Miyu-saki> has quit IRC (*.net *.split)00:07
*** flag <[email protected]> has quit IRC (*.net *.split)00:07
*** Zaba <Zaba!80b9b4b35e@2a03:6000:1812:100::116> has quit IRC (*.net *.split)00:07
*** dxld <dxld!a6d27c8ee6@2a03:6000:1812:100::52> has quit IRC (*.net *.split)00:07
*** chipb <chipb!f66cb56686@user/chipb> has quit IRC (*.net *.split)00:07
*** sugarbeet <[email protected]> has quit IRC (*.net *.split)00:07
*** knielsen <[email protected]> has quit IRC (*.net *.split)00:07
*** DoubleJ <DoubleJ!~DoubleJ@user/doublej> has quit IRC (*.net *.split)00:07
*** edm <[email protected]> has quit IRC (*.net *.split)00:07
*** flokli <[email protected]> has quit IRC (*.net *.split)00:07
*** Psentee <Psentee!~psentee@user/psentee> has quit IRC (*.net *.split)00:07
*** ZipCPU <[email protected]> has quit IRC (*.net *.split)00:07
*** xutaxkamay <xutaxkamay!~xutaxkama@2a01:e0a:a7e:1050:4488:3146:d3e2:bba0> has quit IRC (*.net *.split)00:07
*** juri_ <[email protected]> has quit IRC (*.net *.split)00:07
*** buhman <buhman!sid411355@user/buhman> has quit IRC (*.net *.split)00:07
*** bjonnh <[email protected]> has quit IRC (*.net *.split)00:07
*** tmiw <[email protected]> has quit IRC (*.net *.split)00:07
*** gruetzkopf <gruetzkopf!~quassel@wireguard/tunneler/gruetzkopf> has quit IRC (*.net *.split)00:07
*** gatecat <[email protected]> has quit IRC (*.net *.split)00:07
*** esden <[email protected]> has quit IRC (*.net *.split)00:07
*** Raito_Bezarius <Raito_Bezarius!~Raito@wireguard/tunneler/raito-bezarius> has quit IRC (*.net *.split)00:07
*** mwk <mwk!~mwk@yosys/mwk> has quit IRC (*.net *.split)00:07
*** unkraut <[email protected]> has quit IRC (*.net *.split)00:07
*** striving <[email protected]> has quit IRC (*.net *.split)00:07
*** mobius <[email protected]> has quit IRC (*.net *.split)00:07
*** tucanae47 <[email protected]> has quit IRC (*.net *.split)00:07
*** ovf <[email protected]> has quit IRC (*.net *.split)00:07
*** bjorkintosh <bjorkintosh!~bjork@user/bjorkintosh> has quit IRC (*.net *.split)00:07
*** tlwoerner <[email protected]> has quit IRC (*.net *.split)00:07
*** trabucayre <[email protected]> has quit IRC (*.net *.split)00:07
*** ats <[email protected]> has quit IRC (*.net *.split)00:07
*** dormito <dormito!~dormito@user/dormito> has quit IRC (*.net *.split)00:07
*** _whitelogger <[email protected]> has quit IRC (*.net *.split)00:07
*** svenn <[email protected]> has quit IRC (*.net *.split)00:07
*** tux3 <tux3!~tux3@user/tux3> has quit IRC (*.net *.split)00:07
*** tokamak <tokamak!~Tokamak@2603:c020:4004:f00:59d7:d5e1:201e:845f> has quit IRC (*.net *.split)00:07
*** peepsalot <peepsalot!~peepsalot@openscad/peepsalot> has quit IRC (*.net *.split)00:07
*** dnm <[email protected]> has quit IRC (*.net *.split)00:07
*** ymherklotz <ymherklotz!cb2c9cfbdd@2a03:6000:1812:100::29a> has quit IRC (*.net *.split)00:07
*** muuo <muuo!939aa3488f@user/muuo> has quit IRC (*.net *.split)00:07
*** jleightcap <jleightcap!7bc4014b62@user/jleightcap> has quit IRC (*.net *.split)00:07
*** Lord_Nightmare <Lord_Nightmare!~Lord_Nigh@user/lord-nightmare/x-3657113> has quit IRC (*.net *.split)00:07
*** nonchip <[email protected]> has quit IRC (*.net *.split)00:07
*** janrinze <[email protected]> has quit IRC (*.net *.split)00:07
*** Stary <Stary!Stary@hacksoc/infrastructure> has quit IRC (*.net *.split)00:07
*** TD-Linux <TD-Linux!~Thomas@user/meow/TD-Linux> has quit IRC (*.net *.split)00:07
*** mrec <mrec!~mrec@user/mrec> has quit IRC (*.net *.split)00:07
*** DX-MON <[email protected]> has quit IRC (*.net *.split)00:07
*** mithro <[email protected]> has quit IRC (*.net *.split)00:07
*** sorear <[email protected]> has quit IRC (*.net *.split)00:07
*** MoeIcenowy <[email protected]> has quit IRC (*.net *.split)00:07
*** Ekho <Ekho!~Ekho@user/ekho> has joined #yosys00:07
*** smkz <smkz!~x@user/smkz> has joined #yosys00:07
*** dys <dys!~dys@user/dys> has joined #yosys00:07
*** puddingpimp <[email protected]> has joined #yosys00:07
*** lilibox <[email protected]> has joined #yosys00:07
*** tcal <[email protected]> has joined #yosys00:07
*** darkling <darkling!~darkling@2001-ba8-1f1-f0e6-0-0-0-2.autov6rev.bitfolk.space> has joined #yosys00:07
*** Kamilion <[email protected]> has joined #yosys00:07
*** tnt <tnt!~tnt@osmocom/tnt> has joined #yosys00:07
*** somlo <[email protected]> has joined #yosys00:08
*** nonchip <[email protected]> has joined #yosys00:08
*** bjorkintosh <bjorkintosh!~bjork@user/bjorkintosh> has joined #yosys00:08
*** tlwoerner <[email protected]> has joined #yosys00:08
*** peepsalot <peepsalot!~peepsalot@openscad/peepsalot> has joined #yosys00:08
*** dnm <[email protected]> has joined #yosys00:08
*** trabucayre <[email protected]> has joined #yosys00:08
*** ats <[email protected]> has joined #yosys00:08
*** dormito <dormito!~dormito@user/dormito> has joined #yosys00:08
*** _whitelogger <[email protected]> has joined #yosys00:08
*** janrinze <[email protected]> has joined #yosys00:08
*** svenn <[email protected]> has joined #yosys00:08
*** tux3 <tux3!~tux3@user/tux3> has joined #yosys00:08
*** mrec <mrec!~mrec@user/mrec> has joined #yosys00:08
*** muuo <muuo!939aa3488f@user/muuo> has joined #yosys00:08
*** ymherklotz <ymherklotz!cb2c9cfbdd@2a03:6000:1812:100::29a> has joined #yosys00:08
*** jleightcap <jleightcap!7bc4014b62@user/jleightcap> has joined #yosys00:08
*** tokamak <tokamak!~Tokamak@2603:c020:4004:f00:59d7:d5e1:201e:845f> has joined #yosys00:08
*** Stary <Stary!Stary@hacksoc/infrastructure> has joined #yosys00:08
*** TD-Linux <TD-Linux!~Thomas@user/meow/TD-Linux> has joined #yosys00:08
*** tucanae47 <[email protected]> has joined #yosys00:08
*** ovf <[email protected]> has joined #yosys00:08
*** swiftgeek <swiftgeek!~swiftgeek@user/meow/swiftgeek> has joined #yosys00:08
*** MyNetAz <MyNetAz!~MyNetAz@user/MyNetAz> has quit IRC (Write error: Connection reset by peer)00:08
*** kristianpaul <kristianpaul!~paul@user/kristianpaul> has joined #yosys00:09
*** Wolfvak <Wolfvak!~Wolfvak@user/wolfvak> has joined #yosys00:09
*** _catircservices <_catircservices!catircserv@2a01:4f8:c012:5b7:0:1:0:597> has joined #yosys00:09
*** srk <srk!~sorki@user/srk> has joined #yosys00:09
*** anuejn_ <[email protected]> has joined #yosys00:09
*** vup <[email protected]> has joined #yosys00:09
*** adamgreig <adamgreig!~adam@user/agg> has joined #yosys00:09
*** lead.libera.chat sets mode: +o _catircservices00:09
*** jn <jn!~quassel@user/jn/x-3390946> has joined #yosys00:09
*** m42uko <m42uko!~m42uko@user/m42uko> has joined #yosys00:09
*** jix <jix!~jix@user/jix> has joined #yosys00:09
*** cyrozap <cyrozap!~cyrozap@user/cyrozap> has joined #yosys00:09
*** marex <marex!~marex@user/marex> has joined #yosys00:09
*** flokli <[email protected]> has joined #yosys00:09
*** Psentee <Psentee!~psentee@user/psentee> has joined #yosys00:09
*** ZipCPU <[email protected]> has joined #yosys00:09
*** xutaxkamay <xutaxkamay!~xutaxkama@2a01:e0a:a7e:1050:4488:3146:d3e2:bba0> has joined #yosys00:09
*** juri_ <[email protected]> has joined #yosys00:09
*** buhman <buhman!sid411355@user/buhman> has joined #yosys00:09
*** bjonnh <[email protected]> has joined #yosys00:09
*** tmiw <[email protected]> has joined #yosys00:09
*** gruetzkopf <gruetzkopf!~quassel@wireguard/tunneler/gruetzkopf> has joined #yosys00:09
*** gatecat <[email protected]> has joined #yosys00:09
*** esden <[email protected]> has joined #yosys00:09
*** DX-MON <[email protected]> has joined #yosys00:09
*** mithro <[email protected]> has joined #yosys00:09
*** sorear <[email protected]> has joined #yosys00:09
*** MoeIcenowy <[email protected]> has joined #yosys00:09
*** Raito_Bezarius <Raito_Bezarius!~Raito@wireguard/tunneler/raito-bezarius> has joined #yosys00:11
*** mwk <mwk!~mwk@yosys/mwk> has joined #yosys00:11
*** unkraut <[email protected]> has joined #yosys00:11
*** striving <[email protected]> has joined #yosys00:11
*** mobius <[email protected]> has joined #yosys00:11
*** Raito_Bezarius <Raito_Bezarius!~Raito@wireguard/tunneler/raito-bezarius> has quit IRC (Max SendQ exceeded)00:12
*** Raito_Bezarius <Raito_Bezarius!~Raito@2001:bc8:38ee:100::10> has joined #yosys00:14
*** Semisol[m] <Semisol[m]!semisolsem@2a01:4f8:c012:5b7:0:1:0:56d> has joined #yosys00:16
*** Guest1880 <Guest1880!~root@user/Miyu-saki> has joined #yosys00:16
*** flag <[email protected]> has joined #yosys00:16
*** Zaba <Zaba!80b9b4b35e@2a03:6000:1812:100::116> has joined #yosys00:16
*** chipb <chipb!f66cb56686@user/chipb> has joined #yosys00:16
*** dxld <dxld!a6d27c8ee6@2a03:6000:1812:100::52> has joined #yosys00:16
*** sugarbeet <[email protected]> has joined #yosys00:16
*** knielsen <[email protected]> has joined #yosys00:16
*** DoubleJ <DoubleJ!~DoubleJ@user/doublej> has joined #yosys00:16
*** edm <[email protected]> has joined #yosys00:16
*** MyNetAz <[email protected]> has joined #yosys00:37
*** mrec <mrec!~mrec@user/mrec> has quit IRC (Remote host closed the connection)03:37
*** FabM <FabM!~FabM@armadeus/team/FabM> has joined #yosys07:16
*** krispaul <[email protected]> has joined #yosys08:03
*** kristianpaul <kristianpaul!~paul@user/kristianpaul> has quit IRC (Ping timeout: 248 seconds)08:04
*** lxsameer <lxsameer!~lxsameer@Serene/lxsameer> has joined #yosys10:04
*** lxsameer <lxsameer!~lxsameer@Serene/lxsameer> has quit IRC (Ping timeout: 245 seconds)10:23
*** lxsameer <lxsameer!~lxsameer@Serene/lxsameer> has joined #yosys12:16
*** Adrien[m] <Adrien[m]!adrienpbma@2a01:4f8:c012:5b7:0:1:0:7e> has joined #yosys14:59
Adrien[m]Hi ! I'm trying to synthesize a verilog component with yosys, for xilinx target. But I'm hitting a issue related to some defparam but there are nodefparam in the design... Is there any known issue about that in yosys ?14:59
Adrien[m]ZipCPU: it is your component `aximm2s`, looks very promising to  experiment with hardware acceleration on Zynq :-)14:59
Adrien[m]I've created a small archive with the code. note that the top-level is generated by ghdl. just type make. https://cloud.univ-grenoble-alpes.fr/s/zjjt8PpimRdzjxs15:04
tpbTitle: Cloud UGA (at cloud.univ-grenoble-alpes.fr)15:04
*** hwpplayer1 <hwpplayer1!~user@user/hwpplayer1> has joined #yosys15:06
*** hwpplayer1 <hwpplayer1!~user@user/hwpplayer1> has quit IRC (Read error: Connection reset by peer)15:12
*** hwpplayer1 <hwpplayer1!~user@user/hwpplayer1> has joined #yosys15:15
Adrien[m]Here is the error message :... (full message at <https://catircservices.org/_irc/v1/media/download/AYp-PFsZD0ZoBVV6EzJ3ERb5JY6YimZQbldEc4TBawrrZcoW0T-xsgUeZfTaz-WHj4gecKhEGfq12yo1FFI9Ate_8AAAAAAAAGNhdGlyY3NlcnZpY2VzLm9yZy9lU2xoVUZZVkFNdnl4eUlaWEZJZVhBV2M>)15:27
ZipCPUHello, Adrien[m].  Yes, I have an aximm2s component.  I imagine others may have built their own as well.  You can find mine at https://github.com/ZipCPU/wb2axip/blob/master/rtl/aximm2s.v15:32
ZipCPU(Judging from your .tar.gz file, that's what you already have ...)15:37
ZipCPUI can't comment on whatever ghdl is up to (don't have the most recent version installed here ...), but yosys seems to have no problems with aximm2s on down--save one: you also need the sfifo.v file from wb2axip.15:39
Adrien[m]I provided the ghdl-generated verilog in the archive to ease reproducing the issue. I'll add sfifo.v and try again.15:41
ZipCPUSorry, I just don't do much with VHDL, so I can't reproduce that part of your issue.15:45
Adrien[m]No improvement with sfifo.v added : Yosys is still complaining. I'm now using a freshly-compiled yosys. If the version you are using is older then I'm probably hitting a regression.15:48
ZipCPUCould be, but remember I'm also running from aximm2s.v on down, without touching the VHDL files.15:50
Adrien[m]What is most weird is that there is no defparam anywhere, even in the ghdl-generated code. That generated code is the simplest form of verilog imaginable so it's very easy to scan for dubious generate code - I found nothing...15:51
*** hwpplayer1 <hwpplayer1!~user@user/hwpplayer1> has quit IRC (Ping timeout: 252 seconds)15:52
ZipCPUTry this: Set the parameters of aximm2s explicitly, rather than overriding them.  Remove the "generic" portion of the component declaration.  See if that helps.15:53
Adrien[m]I think I have found the root cause, in the instantiation of aximm2s. Indeed coming from vhdl eases triggering that issue. Two parameters are (erroneously) set here, because they provide the size of some ports. But these are localparams in the aximm2s implementation, so setting these externally is forbidden, and the error message is misleading.16:05
ZipCPUo/16:09
ZipCPUIt would certainly be a Verilog error to try to override a localparam.16:10
Adrien[m]You did guide me in the right direction. Thanks !16:11
ZipCPUYou did all the work.  Still, I'm glad I could help.16:11
Adrien[m]So we will use a slightly edited aximm2s to continue our experiments : convert these 2 localparams to parameters, so they can be declared in vhdl side, and be referenced in port declarations. That'll do for now.16:13
Adrien[m]I've got a real question for you, though : have you already worked with Zynq-7000 SoC ? It uses AXI3. So initially we thought to experiment with axi32axi and axi3axi3 but comments indicate these are not really finished or validated.16:18
Adrien[m]So I thought we could try modified aximm2s and axis2mm to just cap the burst length to 16, the rest should be compatible. Are there reasons to believe this may not work ?16:19
*** flag <[email protected]> has quit IRC (Ping timeout: 246 seconds)16:19
*** flag <[email protected]> has joined #yosys16:21
ZipCPUAdrien[m]: That's pretty close to what you might need to do.16:22
ZipCPUThe issue with conversion from AXI4 to AXI3 is that ... I haven't gotten the logic working (yet) to convert bursts to smaller burst sizes.16:23
ZipCPUHowever, if you just limit the burst size to 16 beats you are then over halfway there.16:23
ZipCPUYou'll also want to set both bits of AxLOCK to zero.  (AXI3 has a two bit AxLOCK value)  You're likely to want to double check the AxCACHE bits.16:24
ZipCPUOh, and you'll need to set WID to the AX_ID used by the MM2S controller.16:24
ZipCPUThose should be all the updates you need.16:24
ZipCPU(Why AxCACHE?  Because the meaning of that bit-field changed between AXI3 and AXI4 as I recall.)16:25
*** lxsameer <lxsameer!~lxsameer@Serene/lxsameer> has quit IRC (Ping timeout: 276 seconds)16:55
*** hwpplayer1 <hwpplayer1!~user@user/hwpplayer1> has joined #yosys17:30
*** orhosko <[email protected]> has joined #yosys17:44
orhoskohello everyone,17:49
orhoskoI'm trying to create a byte/halfword/word addressable bsram for tangnano20k. I both tried 32 bit memory and 8 bit one. 32 bit one fails when addr%4==1 etc. since it requires to access more than 1 word at the same time. And 8 bit based cannot be synthesized I'm not sure why. Do you have any ideas or some example. Or is it just not possible?17:49
orhoskoHere is my code if it helps:17:49
orhosko```17:49
orhosko  (* ram_style = "block" *) // errors if not possible17:49
orhosko  logic [7:0] mem[2**12];  // 4KB example17:49
orhosko  logic [3:0] write_enable;17:49
orhosko  always_comb begin17:49
orhosko    case (fn3)17:49
orhosko      `FN3_SB: write_enable = 4'b0001;17:49
orhosko      `FN3_SH: write_enable = 4'b0011;17:49
orhosko      `FN3_SW: write_enable = 4'b1111;17:49
orhosko      default: write_enable = 4'b0000;17:49
orhosko    endcase17:49
orhosko  end17:49
orhosko  logic [31:0] rdata;17:49
orhosko  integer i;17:49
orhosko  always @(negedge clk) begin17:49
orhoskoI broke the for part while pasting. It should be17:51
orhosko```17:51
orhosko  always @(negedge wclk) begin17:51
orhosko    rdata <= 0;17:51
orhosko    for (i = 0; i < 4; i = i + 1) begin17:51
orhosko      if (write_enable[i] && wr_en) mem[_addr_in+i] <= data_in[8*i+:8];17:51
orhosko      rdata[8*i+:8] <= mem[_addr_in+i];17:51
orhosko    end17:51
orhosko  end17:51
orhosko```17:51
janrinzeorhosko: do you really want negedge there?17:54
orhoskojanrinze: all the other part uses posedge, it is single cycle core and it is working in a simulation only that way. Is it that bad a thing?:/17:56
janrinzeorhosko: why not double the frequency and have it a dual cycle CPU?17:57
orhoskoIf this is not possible it will be the only solution i guess17:58
janrinzeanyway, it seems like you are making it way more complicated than it is. You probably want to do byte access, halfword access and word access.17:58
janrinzebyte access usually allows for all sequential bytes, not just the bottom byte of the 32 bit word.17:59
janrinzeDo you only want to access the bottom byte?17:59
orhoskoisn't this byte address, I'm not sure how can i simplify18:00
janrinzewell your example writes to a bottom byte, bottom half word or a word. Right?18:00
janrinzeAh.. you are trying to have a byte wide memory to do 4 writes in one go with word writes!18:01
orhoskoI don't think so word size 32 but I use byte addressing.18:01
orhoskoyes exactly18:01
janrinzethat requires 4 write ports to the same memory.18:02
orhoskoso being not synthesizable was correct18:02
*** lxsameer <lxsameer!~lxsameer@Serene/lxsameer> has joined #yosys18:03
orhoskoif I made it 32 bit wide it would still require 2 write ports right? not correctly alligned writes would access 2 words18:03
orhoskoand i believe it would require more logic18:04
janrinzeyes that could work.18:04
orhoskoI'm not sure whether 2 write ports is allowed though18:04
janrinzeyou can have true dual-port RAM that allows 2 ports18:04
janrinzeso that will work.18:04
janrinzeis the CPU your own design or has it a known ISA?18:05
orhoskoit is riscv i should have mentioned that too...18:06
orhoskois there a good resource that you know18:06
orhoskois true dual-port RAM supports 2 write + 1 read. That would be 3 ports.18:06
janrinzeRISC-V can do byte access.. just use the proper write flags from the RISC-V18:06
janrinzeread/write can be done on one port18:07
orhoskoim not sure what would be the proper flags.18:07
janrinzetrue dual-port can do read and write on port 1 , read and write on port218:08
orhosko>read/write can be done on one port18:09
orhoskothen still i cannot write a word to not word alligned address. I am not sure if it is required in the specification. If not this will be the best solution for my case ig.18:09
janrinzenormally there is are 4 byte select bits. the CPU will choose which bytes from the 32 bit word are written to.18:09
orhoskoi didn't understand:(18:10
janrinzeI don't know if RISC-V actually allows non-word aligned word-access. Most CPUs would read 2 words sequentially and then shift it to align.18:10
janrinzea 32 bit bus to memory would have 4 signals to let the memory know which byte will be written to. 18:13
orhoskook it make sense. a quick search says it is not mandatory to support non-word aligned word-access.18:13
janrinzehttps://github.com/ultraembedded/riscv/blob/master/core/riscv/riscv_core.v the ouput mem_d_wr_o is 4 bits. one for each byte18:15
janrinzeThe CPU should handle the non-word aligned access. Not the memory.18:15
orhoskoso byte access will be write_enable = 1 << _addr_in[1:0] kind of thing.18:15
orhoskohalfword similarly18:15
orhoskoword access split to 2 words is not necessary. if I understanded correctly.18:15
janrinzeactually the address should be in words, the byte lanes are each one bit.18:16
orhosko> The CPU should handle the non-word aligned access. Not the memory.18:17
orhoskoThis really make sense I have been trying to create a bad abstraction happen for hours18:17
janrinzebut yes, if you want to handle it in the memory you need the bottom two bits.18:17
janrinzethat last line referred to the bytelanes. not to your last comment18:18
orhosko> actually the address should be in words18:18
orhoskoisnt riscv byte addressable. the other way seems way harder18:18
janrinzethe CPU can do byte access.. it will select the right byte from the word.18:18
orhoskokinda meaningless question i know but which one do you recommend18:19
janrinzethe memory itself is 32 bit.18:19
orhoskobyte addressable memory or selecting correct parts from the 32 bit memory18:20
janrinzeuse 32 bit access and use the 4 byte select.18:20
orhoskothank you so much it really makes sense.18:20
janrinze:-)18:21
orhoskoummm, last question, how can i make byte load into word sized memory in single cycle18:23
orhoskoif i load 32 bits wouldnt it overwrite other parts18:23
janrinzeonly write to the bytes that are selected. not the whole 32 bit word.18:27
orhoskomy brain melted i guess. somehow i thought when 32 bit wide bsram created it can only load 32 bits and there is no masking capability18:29
janrinze    if (w_lane0) mem[addr][7:0]<= data[7:0]; if (w_lane1) mem[addr][15:8]<=data[15:8] .. etc.18:29
janrinzethe w_laneX is  the mask!18:29
orhoskobut will this synthesized or require 4 ports again18:30
janrinzealways @(negedge wclk) begin18:32
janrinze     for (i = 0; i < 4; i = i + 1) begin18:32
janrinze       if (write_enable[i] && wr_en) mem[_addr_in>>2][8*i+:8] <= data_in[8*i+:8];18:32
janrinze     end18:32
janrinze     rdata <= mem[_addr_in];18:32
janrinzeend18:32
janrinzeoops rdata <= mem[_addr_in>>2];18:33
janrinzeand make mem 32 bits wide.18:33
janrinzethe CPU should figure out which byte it wanted to read..18:34
janrinzeI hope this is not a home-work assignment ;-)18:34
orhoskono lol. just nerd-sniped from my friend. he bought the fpga and we are trying to create our own core.18:35
janrinzethe write_enable bits are the same bits as the mem_d_wr_o in the link.18:39
orhoskoI'm currently testing18:40
orhosko  (* ram_style = "block" *) // errors if not possible18:40
orhosko  logic [31:0] mem[2**12];  // 4KB example18:40
orhosko  logic [3:0] write_enable;18:40
orhosko  always_comb begin18:40
orhosko    case (fn3)18:41
orhosko      `FN3_SB: write_enable = 1 << (_addr_in[1:0]);18:41
orhosko      `FN3_SH: write_enable = 3 <<(_addr_in[1:0]); // TODO: check misallignment18:41
orhosko      `FN3_SW: write_enable = 4'b1111;18:41
orhosko      default: write_enable = 4'b0000;18:41
orhosko    endcase18:41
orhosko  end18:41
orhosko  logic [31:0] rdata;18:41
orhosko  integer i;18:41
orhosko  always @(negedge wclk) begin18:41
orhosko    for (i = 0; i < 4; i = i + 1) begin18:41
orhosko      if (write_enable[i] && wr_en) mem[_addr_in>>2][8*i+:8] <= data_in[8*i+:8];18:41
orhosko    end18:41
orhoskolast part is wrong i noticed that now.18:43
orhoskoprobably i tried like this earlier and got frustrated then switched to 8 bit wide18:43
orhoskoit should select depending onto address18:44
janrinzeusually we don't post multi-line comments like this but use links to files as in https://bpa.st/ and add the link here.18:44
tpbTitle: Create new paste (at bpa.st)18:44
orhosko> usually we don't post multi-line comments like this but use links to files as in https://bpa.st/ and add the link here.18:46
orhoskoohh, sorry i didn't know that18:46
tpbTitle: Create new paste (at bpa.st)18:46
janrinzesee here: https://bpa.st/LRTQ18:49
tpbTitle: View paste LRTQ (at bpa.st)18:49
janrinzeorhosko: it's the nettiquette to use links. That way we don't spam the channel.18:52
janrinzethe link  https://bpa.st/LRTQ has a small fix for the half-word read and adds the actual read.18:53
tpbTitle: View paste LRTQ (at bpa.st)18:53
janrinzeorhosko: Do you use github? Tha might be easier too.18:54
orhoskojanrinze: i should have guessed you are right. https://github.com/orhosko/fpga-core/tree/memory is the github18:57
orhoskobut i havent pushed yet18:57
orhoskohttps://bpa.st/555Q is the current code18:58
tpbTitle: View paste 555Q (at bpa.st)18:58
janrinzeI see you added a method to realign the reads. nice. 19:02
orhoskoit synthesize but seems like i have some logic errors in other places19:05
orhoskothank you for everything19:06
janrinzeorhosko: I think your issues are not yosys related. perhaps you want to move to #verilog ?19:06
janrinzeorhosko: you're welcome. :-) always nice to help out.19:06
orhoskojanrinze actually i should have stop im missing my bus19:06
orhoskothank you again19:07
orhoskogood evening19:07
*** orhosko <[email protected]> has quit IRC (Quit: Client closed)19:09
janrinzewhile i'm here I might just as well ask: can a pcf file have the drive strength for a pin for HX8K?19:11
*** lxsameer <lxsameer!~lxsameer@Serene/lxsameer> has quit IRC (Ping timeout: 248 seconds)19:34
*** m42uko_ <m42uko_!~m42uko@user/m42uko> has joined #yosys20:01
*** m42uko <m42uko!~m42uko@user/m42uko> has quit IRC (Ping timeout: 252 seconds)20:01
*** FabM <FabM!~FabM@armadeus/team/FabM> has quit IRC (Ping timeout: 245 seconds)20:21
*** lxsameer <lxsameer!~lxsameer@Serene/lxsameer> has joined #yosys20:43
*** lxsameer <lxsameer!~lxsameer@Serene/lxsameer> has quit IRC (Ping timeout: 260 seconds)20:53
*** hwpplayer1 <hwpplayer1!~user@user/hwpplayer1> has quit IRC (Remote host closed the connection)22:08
*** bjorkintosh <bjorkintosh!~bjork@user/bjorkintosh> has quit IRC (Quit: "Every day, computers are making people easier to use." David Temkin)22:10
*** bjorkintosh <bjorkintosh!~bjork@user/bjorkintosh> has joined #yosys22:12
*** nonchip <[email protected]> has quit IRC (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)23:05
*** nonchip <[email protected]> has joined #yosys23:05
*** whitequark[cis] <whitequark[cis]!whitequark@2a01:4f8:c012:5b7:0:1:0:4> has joined #yosys23:05
whitequark[cis]HX8K does not have configurable drive strength23:05

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!