Skip to content

Conversation

@aaronfranke
Copy link
Contributor

@aaronfranke aaronfranke commented Jan 8, 2023

Description

This PR adds support for displaying the ISA string (like "rv64gc") in the CPU section on RISC-V CPUs.

I have tested this both on real hardware (Debian on StarFive VisionFive 2) and an emulator (Ubuntu on Qemu).

Example output on real hardware (Debian on StarFive VisionFive 2):

$ ./runner.py 
                                   user@starfive 
       _,met$$$$$gg.               ------------- 
    ,g$$$$$$$$$$$$$$$P.            OS: Debian GNU/Linux bookworm/sid riscv64 
  ,g$$P"        \"""Y$$.".         Host: StarFive VisionFive V2 
 ,$$P'              `$$$.          Kernel: 5.15.0-starfive 
',$$P       ,ggs.     `$$b:        Uptime: 1 hour, 42 mins 
`d$$'     ,$P"'   .    $$$         Packages: 1883 (dpkg), 15 (cargo) 
 $$P      d$'     ,    $$P         Shell: bash 5.1.16 
 $$:      $$.   -    ,d$$'         Resolution: 3840x2160 
 $$;      Y$b._   _,d$P'           Terminal: /dev/pts/1 
 Y$$.    `.`"Y$$$$P"'              CPU: sifive,u74-mc rv64gc (4) @ 1.500GHz 
 `$$b      "-.__                   Memory: 650.87 MiB / 7927.83 MiB 
  `Y$$                     
   `Y$$.                                                   
     `$$b.                                                 
       `Y$$b.              
          `"Y$b._          
              `\"""        

Example output on the emulator (Ubuntu 20.04 on Qemu):

$ ./runner.py 
                                              ubuntu@ubuntu 
                             ....             ------------- 
              .',:clooo:  .:looooo:.          OS: Ubuntu 20.04.2 LTS riscv64 
           .;looooooooc  .oooooooooo'         Host: riscv-virtio,qemu 
        .;looooool:,''.  :ooooooooooc         Kernel: 5.8.0-14-generic 
       ;looool;.         'oooooooooo,         Uptime: 44 mins 
      ;clool'             .cooooooc.  ,,      Packages: 760 (dpkg) 
         ...                ......  .:oo,     Shell: bash 5.0.17 
  .;clol:,.                        .loooo'    Terminal: /dev/pts/0 
 :ooooooooo,                        'ooool    CPU: rv64gch (8) 
'ooooooooooo.                        loooo.   Memory: 0.34 GiB / 15.62 GiB (2%) 
'ooooooooool                         coooo.   Network: Unknown 
 ,loooooooc.                        .loooo.
   .,;;;'.                          ;ooooc                            
       ...                         ,ooool.                            
    .cooooc.              ..',,'.  .cooo.  
      ;ooooo:.           ;oooooooc.  :l.   
       .coooooc,..      coooooooooo.       
         .:ooooooolc:. .ooooooooooo'       
           .':loooooo;  ,oooooooooc        
               ..';::c'  .;loooo:'         
                             .

For comparison, here is what the output looks like in hyfetch before this PR:

Details Old/existing output on real hardware (Debian on StarFive VisionFive 2):
$ hyfetch 
                                   user@starfive 
       _,met$$$$$gg.               ------------- 
    ,g$$$$$$$$$$$$$$$P.            OS: Debian GNU/Linux bookworm/sid riscv64 
  ,g$$P"        \"""Y$$.".         Host: StarFive VisionFive V2 
 ,$$P'              `$$$.          Kernel: 5.15.0-starfive 
',$$P       ,ggs.     `$$b:        Uptime: 1 hour, 42 mins 
`d$$'     ,$P"'   .    $$$         Packages: 1883 (dpkg), 15 (cargo) 
 $$P      d$'     ,    $$P         Shell: bash 5.1.16 
 $$:      $$.   -    ,d$$'         Resolution: 3840x2160 
 $$;      Y$b._   _,d$P'           Terminal: /dev/pts/1 
 Y$$.    `.`"Y$$$$P"'              CPU: sifive,u74-mc (4) @ 1.500GHz
 `$$b      "-.__                   Memory: 650.87 MiB / 7927.83 MiB 
  `Y$$                     
   `Y$$.                                                   
     `$$b.                                                 
       `Y$$b.              
          `"Y$b._          
              `\"""        

Old/existing output on the emulator (Ubuntu 20.04 on Qemu):

$ hyfetch 
                                              ubuntu@ubuntu 
                             ....             ------------- 
              .',:clooo:  .:looooo:.          OS: Ubuntu 20.04.2 LTS riscv64 
           .;looooooooc  .oooooooooo'         Host: riscv-virtio,qemu 
        .;looooool:,''.  :ooooooooooc         Kernel: 5.8.0-14-generic 
       ;looool;.         'oooooooooo,         Uptime: 44 mins 
      ;clool'             .cooooooc.  ,,      Packages: 760 (dpkg) 
         ...                ......  .:oo,     Shell: bash 5.0.17 
  .;clol:,.                        .loooo'    Terminal: /dev/pts/0 
 :ooooooooo,                        'ooool    CPU: (8) 
'ooooooooooo.                        loooo.   Memory: 0.34 GiB / 15.62 GiB (2%) 
'ooooooooool                         coooo.   Network: Unknown 
 ,loooooooc.                        .loooo.
   .,;;;'.                          ;ooooc                            
       ...                         ,ooool.                            
    .cooooc.              ..',,'.  .cooo.  
      ;ooooo:.           ;oooooooc.  :l.   
       .coooooc,..      coooooooooo.       
         .:ooooooolc:. .ooooooooooo'       
           .':loooooo;  ,oooooooooc        
               ..';::c'  .;loooo:'         
                             .

@hykilpikonna hykilpikonna merged commit 139b892 into hykilpikonna:master Jan 9, 2023
@hykilpikonna
Copy link
Owner

Nice feature, thanks!

@aaronfranke aaronfranke deleted the riscv-isa branch January 9, 2023 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants