Skip to content

ZiYang-xie/ICS_Y86

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ICS_2020_PJ

写在前面:欢迎大家来到我们的repo。因为时间的局限,我们的文档和代码都有许多不规范的地方,技术上也有很多工程上的trade-off,请大家见谅~如果有任何问题,可以发起issue或者pull request。希望大家能喜欢我们的作品。

环境要求

  1. MacOSX 10.15

  2. Python3.7

  3. Cmake3.1.7或更高

  4. Apple clang version 11.0.3

  5. anywhere 1.5.0 (npm install anywhere)

  6. Flask 1.1.2 (包含 flask_cors 跨域)

如何运行

可执行文件

后端主程序

主程序为Backend/build/ICS_Y86,运行方法为

./Backend/Assembler/yyas -r $path_to_file_name/$file_name | ./Backend/build/ICS_Y86

测试程序(建议使用)

cd ./Backend/test/build
./Google_Tests_run 

自行编译

使用测试模块

为了方便项目的开发,我们已经将所有的y86-code(非honor部分)的测试写入了main_test.cpp,按如下步骤即可编译运行

cd ./Backend/test/build
cmake ..
make 
./Google_Tests_run 

同时测试中还有我们写的针对每一条指令的测试,如果助教不嫌弃明年也可以直接给下一届的同学用(在Stage2中还会扩充)

手动测试

如果希望进行手动测试,需要先要先把$filename.yo转成无注释的版本,再以stdin的形式输入 先进行编译

cmake .
make
cd ./Backend/build
../Assembler/yyas -r $path_to_file_name/$file_name | ./ICS_Y86 

前端用户版本

在使用前端交互版本前,请先 make 后端文件,记得宏定义 OUTPUT_JSON 以保证 CPU 能够正常输出 data.json

  1. 在 Index 目录下运行 flask 后端服务器
python3 launch.py
  1. 另起终端在 Index 目录下运行 anywhere
anywhere

会自动弹出服务器运行本地 index 入口,之后请尽情使用。

项目已知的bug

  1. CPI计算在STALL情况下,可能会出现错误
  2. 前端的进度条如果超过1000个cycle,有时可能拖动不到最右边