Saturday, 2023-05-13

*** midnight <midnight!~midnight@user/midnight> has quit IRC06:34
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC07:53
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@176.59.54.8> has joined #libre-soc07:53
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@176.59.54.8> has quit IRC08:03
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc10:29
*** ghostmansd <ghostmansd!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC11:11
*** ghostmansd <ghostmansd!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc11:12
*** ghostmansd <ghostmansd!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC11:42
*** ghostmansd <ghostmansd!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc11:43
*** ghostmansd <ghostmansd!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC11:50
*** ghostmansd <ghostmansd!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc11:50
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC12:10
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@176.59.41.15> has joined #libre-soc12:10
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@176.59.41.15> has quit IRC12:39
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc12:39
*** ghostmansd <ghostmansd!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC12:42
*** ghostmansd <ghostmansd!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc12:56
*** ghostmansd <ghostmansd!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc12:57
*** ghostmansd[hexch <ghostmansd[hexch!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc14:54
*** ghostmansd[pc] <ghostmansd[pc]!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc14:54
*** ghostmansd <ghostmansd!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC14:57
*** ghostmansd[hexch <ghostmansd[hexch!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC14:58
*** ghostmansd[hexch <ghostmansd[hexch!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc15:26
*** ghostmansd[pc] <ghostmansd[pc]!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC15:30
*** ghostmansd[pc] <ghostmansd[pc]!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc15:36
*** ghostmansd[hexch <ghostmansd[hexch!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC15:40
*** ghostmansd[hexch <ghostmansd[hexch!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc16:14
*** ghostmansd[pc] <ghostmansd[pc]!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC16:18
*** ghostmansd[pc] <ghostmansd[pc]!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc16:29
*** ghostmansd[hexch <ghostmansd[hexch!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC16:33
*** ghostmansd[pc] <ghostmansd[pc]!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC18:36
*** ghostmansd[pc] <ghostmansd[pc]!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc18:36
ghostmansd[pc]That's me again with execute_one.19:56
ghostmansd[pc]I read your comments folks.19:57
ghostmansd[pc]But still cannot get. We start with an empty insnlog created inside execute_one.19:57
ghostmansd[pc]https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/decoder/isa/caller.py;h=da25bd1e4caa46cbbdb3726a3956727ca58c4b81;hb=refs/heads/master#l170819:59
ghostmansd[pc]https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/decoder/isa/caller.py;h=da25bd1e4caa46cbbdb3726a3956727ca58c4b81;hb=refs/heads/master#l175119:59
ghostmansd[pc]From my point of view, user of ISACaller class must pass trace file (path or writable stream, preferably the latter) upon ISACaller instantiation.19:59
ghostmansd[pc]And all execute_one() invocations should simply populate this file.20:00
ghostmansd[pc]It seems that we never use ISACaller directly, only via ISA class, which inherits from ISACaller (and also from couple of other classes).20:00
ghostmansd[pc]For me `insnlog=[]` and `open(..., "a+")` are mutually exclusive.20:02
ghostmansd[pc]Sorry, meant `self.insnlog`. If it was simply `insnlog`, I'd have considered it a temporary variable.20:02
ghostmansd[pc]From my point of view, we should extend ISACaller.__init__ with `tracefile` argument, and then, whenever we intend to create a trace, we should instantiate ISA with this argument.20:04
ghostmansd[pc]And, even with this in mind, I still don't get why do we keep self.insnlog. Do we really need it to be saved somewhere else other than trace file? Why bother saving it in member variable which survives only until execute_one is called again?20:06
ghostmansd[pc]Ah wait, with self.insnlog I begin to understand. The code is split between methods.20:08
ghostmansd[pc]Annoying.20:08
ghostmansd[pc]OK, so, log _must_ be one per ISA instance, and `self.insnlog` just has to be per-instance and not just transient since we have several methods which can update this variable and we have no desire to pass trace file in each and every one of them.20:12
*** ghostmansd[pc] is now known as ghostmansd20:26
lkcl> We start with an empty insnlog created inside execute_one.20:34
lkclcorrect20:34
lkcl> user of ISACaller class must pass trace file (path or writable stream,20:35
lkclcorrect20:35
lkcl(with detection "if hasattr(self.inslog_stream, write)"20:35
lkclbecause it is possible to pass in a BytesIO instance20:35
lkcl>  upon ISACaller instantiation.20:36
lkclcorrect20:36
lkcl> And all execute_one() invocations should simply populate this file20:36
lkclcorrect20:36
lkcl> It seems that we never use ISACaller directly, only via ISA class20:36
lkclalso correct20:36
lkcl> For me `insnlog=[]` and `open(..., "a+")` are mutually exclusive.20:36
lkclthat's incorrect.20:36
lkcl>  The code is split between methods.20:37
lkclindeed.  thus self.insnlog is used as a deep-level accumulator.  it is populated by functions that are several levels deep20:37
lkcl> we have no desire to pass trace file in each and every one of them.20:37
lkclnnope.20:38
lkclthe propagation would be extreme and intrusive and a maintenance nightmare.20:38
lkcli honestly can't think of a better way to do this.  even a "return insnlog" or "return thing to add" is also intrusive20:39
lkclone option, though: it's a bit lame - just write *directly* to the file.20:39
lkclrip out self.insnlog and write literally the data required, at the time it is available (currently: wherever there is a self.insnlog.append(something))20:40
lkclbut the reason for not doing that is that putting in space-separators is a bit of a pain-in-the-ass...20:41
lkclexcept... you could do20:41
lkclself.insnlog_stream.write("\n%s" % (instruction)) # note the lack of a space after that20:42
lkcland for read/writes:20:42
lkclself.insnlog_stream.write(" rwGPR:%d:%d:%d" % (....)) # note the *inclusion* of the space at the start20:42
lkclthat would be a little more intuitive20:43
lkclbut please do use the "if hasattr(stream, "write")" trick, on the basis that "anything string-like" won't have a write() function20:43
lkclthe only other thing is, don't close the file if it was passed-in (need a bool-detect var for that)20:44
lkclbecause the file was passed in, it should be caller's responsibility to close. or not. as they see fit20:45
*** midnight <midnight!~midnight@user/midnight> has joined #libre-soc21:12

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