{"id":3583,"date":"2024-08-30T17:06:16","date_gmt":"2024-08-30T21:06:16","guid":{"rendered":"https:\/\/www.yorku.ca\/professor\/drsmith\/?p=3583"},"modified":"2024-08-30T17:17:00","modified_gmt":"2024-08-30T21:17:00","slug":"vpl-risc-v-simulation-with-kite-with-random-registers","status":"publish","type":"post","link":"https:\/\/www.yorku.ca\/professor\/drsmith\/2024\/08\/30\/vpl-risc-v-simulation-with-kite-with-random-registers\/","title":{"rendered":"VPL &amp; RISC-V Simulation with Kite (with random registers)"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"alignright size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"811\" height=\"585\" src=\"https:\/\/www.yorku.ca\/professor\/drsmith\/wp-content\/uploads\/sites\/444\/2024\/08\/Screenshot-2024-08-30-at-5.03.12\u202fPM.png\" alt=\"Screenshot of VPL exercise that uses the Kite RISC-V simulator to make a negative integer positive by applying both xori and addi operations.\" class=\"wp-image-3587\" style=\"width:400px\" srcset=\"https:\/\/www.yorku.ca\/professor\/drsmith\/wp-content\/uploads\/sites\/444\/2024\/08\/Screenshot-2024-08-30-at-5.03.12\u202fPM.png 811w, https:\/\/www.yorku.ca\/professor\/drsmith\/wp-content\/uploads\/sites\/444\/2024\/08\/Screenshot-2024-08-30-at-5.03.12\u202fPM-300x216.png 300w\" sizes=\"auto, (max-width: 811px) 100vw, 811px\" \/><figcaption class=\"wp-element-caption\">Screenshot of VPL exercise that uses the Kite RISC-V simulator to make a negative integer positive by applying both xori and addi operations.<\/figcaption><\/figure>\n<\/div>\n\n\n<p>In another post, I set up a basic Virtual Programming Lab exercise for RISC-V simulations with Assembler coding and the Kite simulator.  That example is vulnerable to students hard-coding the register values without actually writing the necessary code.  But I wrote it in order to provide a solid first example.<\/p>\n\n\n\n<p>Here, we're going to write an exercise in VPL that is harder to fool.  We'll do two things to accomplish this.  We will...<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Initialize all register values to random values, and<\/li>\n\n\n\n<li>Allow for specific registers to have specific initial values.<\/li>\n<\/ol>\n\n\n\n<p><em>(In a future blog post I'll deal with running the simulation multiple times, each time with a different set of randomized register values.)<\/em><\/p>\n\n\n\n<p>This works because of two important elements:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The VPL system typically relies on two bash shell scripts to work: vpl_run.sh and vpl_evaluate.sh.<\/li>\n\n\n\n<li>The Kite simulator loads a pair of text files when it starts up.  The first file provides the starting state of the registers and the second file provides the starting state of a bank of memory. (reg_state and mem_state, respectively)<\/li>\n<\/ol>\n\n\n\n<p>So, we'll create a bash script that will initialize that register file to random values.  Now, I'm not a bash scripting person, so I turned to Bing to help me out.  Here is the basic code for generating 30 registers (x0 to x29).  I'll modify this later to permit all 32 registers within vpl_run.sh and vpl_evaluate.sh.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"># File created with Bing\/ChatGPT\n<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">#!\/bin\/bash\n<\/mark>\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\"># Define the output file. (the register state file, reg_state)\n<\/mark>output_file=\"reg_state\"\n\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\"># Define an associative array for specific values\n<\/mark>declare -A specific_values\n\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\"># Example of setting specific values (uncomment and modify as needed)\n# <em>specific_values&#91;5]=12345  # Assign 12345 to the 6th line (index 5)<\/em>\n# <em>specific_values&#91;10]=54321 # Assign 54321 to the 11th line (index 10)<\/em><\/mark>\n\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\"># Function to generate a random 16-bit integer\n<\/mark>generate_random_16bit() {\n    echo $((RANDOM % 32768))\n}\n\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\"># Create or clear the output file\n<\/mark>&gt; \"$output_file\"\n\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\"># Loop to create 30 lines\n<\/mark>for i in {0..29}; do\n    if &#91;&#91; -n \"${specific_values&#91;$i]}\" ]]; then\n        value=\"${specific_values&#91;$i]}\"\n    else\n        value=$(generate_random_16bit)\n    fi\n    echo \"x$i = $value\" &gt;&gt; \"$output_file\"\ndone\n\necho \"File created: $output_file\"<\/code><\/pre>\n\n\n\n<p>This code will generate a file called file.txt with 30 lines in it.  Each line will be of the form A = B, where A is a value like x0, x1, x2, etc. and B  will be some random value.  Now, there are situations where an instructor might want to hard code a register value. The instructor can then write something like <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\"><em>specific_values[5]=12345<\/em><\/mark> to set register x5 to 12345.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>Here's a student problem:<\/p>\n\n\n\n<p>Student task: &nbsp;Take the negative value found in register x6, invert all the bits in register x6 &nbsp;and then add one to the answer. &nbsp;Store that final value in x5.<\/p>\n\n\n\n<p>(this is a variation of existing lab problem, aex3a: \"&nbsp;Convert -5 to +5 by negating its bits and adding 1. Save your solution as a&nbsp;file named aex3a.asm for possible future use.\"<\/p>\n\n\n\n<p>You code up the <em>secret<\/em> teacher solution as this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>xori x7, x6, -1\naddi x5, x7, 1<\/code><\/pre>\n\n\n\n<p>Call this file teacherAssemblerSolution.asm and upload it to the Executable Files section of the VPL exercise.<\/p>\n\n\n\n<p>Now, in VPL, we need to set the <strong>vpl_run.sh<\/strong> file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n#\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\"># <strong>vpl_run.sh<\/strong> script (KITE RISCV version)\n<\/mark># The output of the student program is tested against the expected output file.\n# \n# James Andrew Smith; drsmith@yorku.ca August 30, 2024.\n#\n# Based on example by D. Thiebaut at Smith College\n# http:\/\/www.science.smith.edu\/dftwiki\/index.php\/Tutorial:_Moodle_VPL_--_Testing_a_C_Program\n# and\n# https:\/\/www.mapleprimes.com\/posts\/38232-Scripting-With-Maple\n#\n# Modified for Maple and described here: https:\/\/www.yorku.ca\/professor\/drsmith\/2021\/08\/01\/vpl-using-maple-for-math-assignments\/\n#\n# Updated in August 2024 for Kite simulation and RISC-V.\n# A small section of this used Bing\/ChatGPT to generate random values for the registers.\n# -----------------------------------------------------------------\n\n\ncat &gt; vpl_execution &lt;&lt;EEOOFF\n#!\/bin\/bash\n\n# Variables (make changes here)\nteacherSolution=teacherAssemblerSolution.asm\nstudentProgram=StudentSubmission.asm\nmaxGrade=1\nminGrade=0\nconsolationGrade=0\ninit_register_file=\"reg_state\"\n\n# --- randomize the register state file, reg_state ------\n# this section of the bash script was generated used Bing\/ChatGPT\n# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n\n# Generate an array of 32 random 16-bit unsigned integers\ndeclare -a arr\nfor i in {0..31}; do\n    arr&#91;i]=\\$((RANDOM % 65536))\ndone\n\n# Override specific elements with constant values (example: arr&#91;0] = 1234, arr&#91;15] = -5678)\narr&#91;0]=1234                                 # x1 is fixed to 1234\narr&#91;15]=-5678                               # x15 is fixed to -5678\narr&#91;6]=\\$(( \\$RANDOM - 32768 ))             # x6 is a random negative number.\n\n# Create the string with 32 lines in the form A = B\noutput=\"\"\nfor i in {0..31}; do\n  output+=\"x\\$i = \\${arr&#91;i]}\\n\"\ndone\n# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n# -------------------------------------------------------------------\n\n\n# --- create test (Teacher Solution) ---\n# Write the string to reg_state.txt. (to initialise registers)\necho -e \"\\$output\" &gt; \"\\$init_register_file\"\n\n# run Kite on the teacher solution.  Output to solution.txt.  Extra text to \/dev\/null\necho \"running KITE on teacher solution...\"\n\/eecs\/local\/pkg\/kite\/bin\/kite \\${teacherSolution} &gt; solutionTemp.txt\n\n# erase all lines prior to the string\nsed -i '1,\/Register state:\/d' solutionTemp.txt\n\n# erase all lines at the end of the file after \"elapsed\":\nsed -n '\/elapsed\/q;p' solutionTemp.txt &gt; solution.txt\n\n# Default grade is zero.\ngrade=\\$minGrade\n\nfor i in 1 ; do\n   echo \"TEST \\$i\"\n\n   # ==============================================\n   # TEST i\n   # ==============================================\n\n   # Write the string to reg_state.txt. (to initialise registers)\necho -e \"\\$output\" &gt; \"\\$init_register_file\"\n\n\n   echo \"Running KITE on the student solution...\"\n\n\/eecs\/local\/pkg\/kite\/bin\/kite \\${studentProgram} &gt; userTemp.out\n\n# erase all lines prior to the string\nsed -i '1,\/Register state:\/d' userTemp.out\n\n# erase all lines at the end of the file after \"elapsed\":\nsed -n '\/elapsed\/q;p' userTemp.out &gt; user.out\n\n   # all processing of whitespace to remove it has been, itself removed.\n   # want to see how that's done?  Go to \n   # http:\/\/www.science.smith.edu\/dftwiki\/index.php\/Tutorial:_Moodle_VPL_--_Testing_a_C_Program\n   \n   #--- compute difference, with exact whitespace --- \n   diff -y user.out solution.txt &gt; diff.out\n   \n   # debug:\n #    echo \"----- diff.out ------\"\n #   cat diff.out\n #   echo \"---------------------\"\n\n   \n   #--- reject if different ---\n   if ((\\$? &gt; 0)); then\n      echo \"Your output is NOT correct.\"\n\n\n      echo \"---------------\"\n      echo \"Your output:\"\n      echo \"---------------\"\n      cat user.out\n      \n      echo \"\"\n      echo \"---------------\"\n      echo \"Expected output  \"\n      echo \"---------------\"\n      cat solution.txt\n\n      grade=\\$( expr \\$minGrade )\n   \n      #--- consolation grade (\"thanks for coming out\")---   \n      #grade=\\$( expr \\$consolationGrade )\n\n      # --------------------- REWARD IF CORRECT OUTPUT -----------------\n   else\n      #--- good output ---\n      echo \"Congrats, your output is correct.\"\n      echo \" --------------------------------\"\n      cat user.out\n      echo \"--------------------------------\"\n      grade=\\$( expr \\$maxGrade )\n   fi\ndone\n\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\"># Uncomment this for the vpl_run.sh\n# Comment it for vpl_evaluate.sh\n<\/mark><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">echo \"Possible Grade : \\$grade (you need to evaluate for official grade)\"<\/mark>\n<\/strong>\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-cyan-blue-color\"># Uncomment this for vpl_evaluate.sh.  Otherwise comment it.\n<strong>#echo \"The following grade is being sent to eClass: \\$grade\"\n#echo \"Grade :=&gt;&gt; \\$grade\"<\/strong><\/mark>\n\nexit 0\nEEOOFF\n\n \nchmod +x vpl_execution\nexit 0<\/code><\/pre>\n\n\n\n<p>We also need to define the <strong>vpl_evaluation.sh<\/strong> script:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n#\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-orange-color\"># <strong>vpl_evaluate<\/strong> script (KITE RISCV version)\n<\/mark># The output of the student program is tested against the expected output file.\n# \n# James Andrew Smith; drsmith@yorku.ca August 30, 2024.\n#\n# Based on example by D. Thiebaut at Smith College\n# http:\/\/www.science.smith.edu\/dftwiki\/index.php\/Tutorial:_Moodle_VPL_--_Testing_a_C_Program\n# and\n# https:\/\/www.mapleprimes.com\/posts\/38232-Scripting-With-Maple\n#\n# Modified for Maple and described here: https:\/\/www.yorku.ca\/professor\/drsmith\/2021\/08\/01\/vpl-using-maple-for-math-assignments\/\n#\n# Updated in August 2024 for Kite simulation and RISC-V.\n# A small section of this used Bing\/ChatGPT to generate random values for the registers.\n# -----------------------------------------------------------------\n\n\ncat &gt; vpl_execution &lt;&lt;EEOOFF\n#!\/bin\/bash\n\n# Variables (make changes here)\nteacherSolution=teacherAssemblerSolution.asm\nstudentProgram=StudentSubmission.asm\nmaxGrade=1\nminGrade=0\nconsolationGrade=0\ninit_register_file=\"reg_state\"\n\n# --- randomize the register state file, reg_state ------\n# this section of the bash script was generated used Bing\/ChatGPT\n# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n\n# Generate an array of 32 random 16-bit unsigned integers\ndeclare -a arr\nfor i in {0..31}; do\n    arr&#91;i]=\\$((RANDOM % 65536))\ndone\n\n# Override specific elements with constant values (example: arr&#91;0] = 1234, arr&#91;15] = -5678)\narr&#91;0]=1234                                 # x1 is fixed to 1234\narr&#91;15]=-5678                               # x15 is fixed to -5678\narr&#91;6]=\\$(( \\$RANDOM - 32768 ))             # x6 is a random negative number.\n\n# Create the string with 32 lines in the form A = B\noutput=\"\"\nfor i in {0..31}; do\n  output+=\"x\\$i = \\${arr&#91;i]}\\n\"\ndone\n# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n# -------------------------------------------------------------------\n\n\n# --- create test (Teacher Solution) ---\n# Write the string to reg_state.txt. (to initialise registers)\necho -e \"\\$output\" &gt; \"\\$init_register_file\"\n\n# run Kite on the teacher solution.  Output to solution.txt.  Extra text to \/dev\/null\necho \"running KITE on teacher solution...\"\n\/eecs\/local\/pkg\/kite\/bin\/kite \\${teacherSolution} &gt; solutionTemp.txt\n\n# erase all lines prior to the string\nsed -i '1,\/Register state:\/d' solutionTemp.txt\n\n# erase all lines at the end of the file after \"elapsed\":\nsed -n '\/elapsed\/q;p' solutionTemp.txt &gt; solution.txt\n\n# Default grade is zero.\ngrade=\\$minGrade\n\nfor i in 1 ; do\n   echo \"TEST \\$i\"\n\n   # ==============================================\n   # TEST i\n   # ==============================================\n\n   # Write the string to reg_state.txt. (to initialise registers)\necho -e \"\\$output\" &gt; \"\\$init_register_file\"\n\n\n   echo \"Running KITE on the student solution...\"\n\n\/eecs\/local\/pkg\/kite\/bin\/kite \\${studentProgram} &gt; userTemp.out\n\n# erase all lines prior to the string\nsed -i '1,\/Register state:\/d' userTemp.out\n\n# erase all lines at the end of the file after \"elapsed\":\nsed -n '\/elapsed\/q;p' userTemp.out &gt; user.out\n\n   # all processing of whitespace to remove it has been, itself removed.\n   # want to see how that's done?  Go to \n   # http:\/\/www.science.smith.edu\/dftwiki\/index.php\/Tutorial:_Moodle_VPL_--_Testing_a_C_Program\n   \n   #--- compute difference, with exact whitespace --- \n   diff -y user.out solution.txt &gt; diff.out\n   \n   # debug:\n #    echo \"----- diff.out ------\"\n #   cat diff.out\n #   echo \"---------------------\"\n\n   \n   #--- reject if different ---\n   if ((\\$? &gt; 0)); then\n      echo \"Your output is NOT correct.\"\n\n\n      echo \"---------------\"\n      echo \"Your output:\"\n      echo \"---------------\"\n      cat user.out\n      \n      echo \"\"\n      echo \"---------------\"\n      echo \"Expected output  \"\n      echo \"---------------\"\n      cat solution.txt\n\n      grade=\\$( expr \\$minGrade )\n   \n      #--- consolation grade (\"thanks for coming out\")---   \n      #grade=\\$( expr \\$consolationGrade )\n\n      # --------------------- REWARD IF CORRECT OUTPUT -----------------\n   else\n      #--- good output ---\n      echo \"Congrats, your output is correct.\"\n      echo \" --------------------------------\"\n      cat user.out\n      echo \"--------------------------------\"\n      grade=\\$( expr \\$maxGrade )\n   fi\ndone\n\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\"># Uncomment this for the vpl_run.sh\n# Comment it for vpl_evaluate.sh\n<\/mark><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\"># echo \"Possible Grade : \\$grade (you need to evaluate for official grade)\"<\/mark>\n<\/strong>\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-cyan-blue-color\"># Uncomment this for vpl_evaluate.sh.  Otherwise comment it.\n<strong>echo \"The following grade is being sent to eClass: \\$grade\"\necho \"Grade :=&gt;&gt; \\$grade\"<\/strong><\/mark>\n\nexit 0\nEEOOFF\n\n \nchmod +x vpl_execution\nexit 0<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignright size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"806\" height=\"402\" src=\"https:\/\/www.yorku.ca\/professor\/drsmith\/wp-content\/uploads\/sites\/444\/2024\/08\/image-3.png\" alt=\"VPL execution server with name of server blanked out.\" class=\"wp-image-3585\" style=\"width:400px\" srcset=\"https:\/\/www.yorku.ca\/professor\/drsmith\/wp-content\/uploads\/sites\/444\/2024\/08\/image-3.png 806w, https:\/\/www.yorku.ca\/professor\/drsmith\/wp-content\/uploads\/sites\/444\/2024\/08\/image-3-300x150.png 300w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><figcaption class=\"wp-element-caption\">VPL server selected.<\/figcaption><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>Then, we need to set VPL \"local execution server\".<\/p>\n\n\n\n<p>Specify the requested file.  Call it StudentSubmission.asm<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"832\" height=\"286\" src=\"https:\/\/www.yorku.ca\/professor\/drsmith\/wp-content\/uploads\/sites\/444\/2024\/08\/image-4.png\" alt=\"example submission file.\" class=\"wp-image-3586\" style=\"width:400px\" srcset=\"https:\/\/www.yorku.ca\/professor\/drsmith\/wp-content\/uploads\/sites\/444\/2024\/08\/image-4.png 832w, https:\/\/www.yorku.ca\/professor\/drsmith\/wp-content\/uploads\/sites\/444\/2024\/08\/image-4-300x103.png 300w\" sizes=\"auto, (max-width: 832px) 100vw, 832px\" \/><\/figure>\n\n\n\n<p>Copy the two memory files: <a href=\"https:\/\/github.com\/yonseicasl\/Kite\/blob\/master\/mem_state\">mem_state<\/a> and <a href=\"https:\/\/github.com\/yonseicasl\/Kite\/blob\/master\/reg_state\">reg_state<\/a>, either from the web simulator or from the GitHub respository.  Upload these to the Execution Files folder.  In the Files to Keep when Running page, check off reg_state, mem_state and teacherAssemblerSolution.asm.<\/p>\n\n\n\n<p>In Execution Options, make sure that run script is on autodetect.  Click yes for Run and yes for Evaluate.  Click no for \"evaluate just on submission\" and yes for \"automatic grade\".<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>So, we've now got a proof-of-concept working for Kite simulations with RISC-V assembler student programs working within Virtual Programming Lab.  I'll have to clean this up, make a better tutorial and intro video, but I wanted to post this while it was still on my mind.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Acknowledgements<\/h2>\n\n\n\n<p>I would like to thank Mr. Paul Griffith and Mr. Jason Keltz for helping get the RISC-V tools set up on our EECS department machines.  Colleagues like Mr. Griffith and Keltz are true anchors for departments, like ours, that are so dependent on technology for both teaching and research. <\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"128\" height=\"128\" src=\"https:\/\/www.yorku.ca\/professor\/drsmith\/wp-content\/uploads\/sites\/444\/2021\/12\/noun-signature-1720818-2.png\" alt=\"a pen\" class=\"wp-image-2116\"\/><\/figure>\n<\/div>\n\n\n<p>James Andrew Smith is a Professional Engineer and Associate Professor in the Electrical Engineering and Computer Science\u00a0<a href=\"http:\/\/eecs.lassonde.yorku.ca\">Department<\/a>\u00a0of York University\u2019s\u00a0<a href=\"http:\/\/lassonde.yorku.ca\">Lassonde School<\/a>, with degrees in Electrical and Mechanical Engineering\u00a0from the University of Alberta and McGill University.\u00a0\u00a0Previously a program director in biomedical engineering, his research background spans robotics, locomotion, human birth and\u00a0engineering\u00a0education. While on sabbatical in 2018-19 with his wife and kids he lived in Strasbourg, France and\u00a0he\u00a0taught at the\u00a0<a href=\"https:\/\/www.insa-strasbourg.fr\/en\/\">INSA Strasbourg<\/a>\u00a0and\u00a0<a href=\"https:\/\/www.hs-karlsruhe.de\">Hochschule Karlsruhe<\/a>\u00a0and wrote about his\u00a0<a href=\"https:\/\/twitter.com\/search?q=(%23sabbaticallife)%20(from%3Aonnimikki)&amp;src=typed_query\">personal<\/a>\u00a0and\u00a0<a href=\"https:\/\/twitter.com\/search?q=insa%20(from%3Ajasmith_yorku)&amp;src=typed_query\">professional\u00a0<\/a><a href=\"https:\/\/twitter.com\/search?q=karlsruhe%20(from%3Ajasmith_yorku)&amp;src=typed_query\">perspectives<\/a>.\u00a0\u00a0James is a proponent of using social media to advocate for justice, equity, diversity and inclusion as well as evidence-based applications of research\u00a0in the public sphere.\u00a0You can find him on\u00a0<a href=\"https:\/\/twitter.com\/jasmith_yorku\">Twitter<\/a>. Originally from Qu\u00e9bec City, he now lives in Toronto, Canada.\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In another post, I set up a basic Virtual Programming Lab exercise for RISC-V simulations with Assembler coding and the Kite simulator. That example is vulnerable to students hard-coding the register values without actually writing the necessary code. But I wrote it in order to provide a solid first example. Here, we're going to write [&hellip;]<\/p>\n","protected":false},"author":762,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","footnotes":""},"categories":[43,693,294],"tags":[738,736],"class_list":["post-3583","post","type-post","status-publish","format-standard","hentry","category-assembler","category-risc-v","category-vpl","tag-kite-simulation","tag-kite-simulator"],"taxonomy_info":{"category":[{"value":43,"label":"assembler"},{"value":693,"label":"RISC-V"},{"value":294,"label":"VPL"}],"post_tag":[{"value":738,"label":"Kite simulation"},{"value":736,"label":"Kite simulator"}]},"featured_image_src_large":false,"author_info":{"display_name":"drsmith","author_link":"https:\/\/www.yorku.ca\/professor\/drsmith\/author\/drsmith\/"},"comment_info":"","category_info":[{"term_id":43,"name":"assembler","slug":"assembler","term_group":0,"term_taxonomy_id":43,"taxonomy":"category","description":"","parent":0,"count":30,"filter":"raw","cat_ID":43,"category_count":30,"category_description":"","cat_name":"assembler","category_nicename":"assembler","category_parent":0},{"term_id":693,"name":"RISC-V","slug":"risc-v","term_group":0,"term_taxonomy_id":693,"taxonomy":"category","description":"","parent":0,"count":19,"filter":"raw","cat_ID":693,"category_count":19,"category_description":"","cat_name":"RISC-V","category_nicename":"risc-v","category_parent":0},{"term_id":294,"name":"VPL","slug":"vpl","term_group":0,"term_taxonomy_id":294,"taxonomy":"category","description":"","parent":0,"count":25,"filter":"raw","cat_ID":294,"category_count":25,"category_description":"","cat_name":"VPL","category_nicename":"vpl","category_parent":0}],"tag_info":[{"term_id":738,"name":"Kite simulation","slug":"kite-simulation","term_group":0,"term_taxonomy_id":738,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":736,"name":"Kite simulator","slug":"kite-simulator","term_group":0,"term_taxonomy_id":736,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"}],"_links":{"self":[{"href":"https:\/\/www.yorku.ca\/professor\/drsmith\/wp-json\/wp\/v2\/posts\/3583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yorku.ca\/professor\/drsmith\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yorku.ca\/professor\/drsmith\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yorku.ca\/professor\/drsmith\/wp-json\/wp\/v2\/users\/762"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yorku.ca\/professor\/drsmith\/wp-json\/wp\/v2\/comments?post=3583"}],"version-history":[{"count":6,"href":"https:\/\/www.yorku.ca\/professor\/drsmith\/wp-json\/wp\/v2\/posts\/3583\/revisions"}],"predecessor-version":[{"id":3592,"href":"https:\/\/www.yorku.ca\/professor\/drsmith\/wp-json\/wp\/v2\/posts\/3583\/revisions\/3592"}],"wp:attachment":[{"href":"https:\/\/www.yorku.ca\/professor\/drsmith\/wp-json\/wp\/v2\/media?parent=3583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yorku.ca\/professor\/drsmith\/wp-json\/wp\/v2\/categories?post=3583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yorku.ca\/professor\/drsmith\/wp-json\/wp\/v2\/tags?post=3583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}