在Ubuntu12.04上安装SimpleScalar的方法

【技术】在Ubuntu12.04上安装SimpleScalar的方法 【技术】Install SimpleScalar on Ubuntu 12.04 1.在gedit(Ubuntu自带的文本编辑器)中加入以下代码: NAME=Simplescalar PACKAGE=simplescalar TOOL=simpletools-2v0 UTIL=simpleutils SIM=simplesim sudo apt-get update sudo apt-get install flex-old bison build-essential cd mkdir $NAME cd $NAME wget http://csrl.unt.edu/downloads/$PACKAGE.tgz tar xvfz $PACKAGE.tgz export CC="gcc" export HOST=i686-unknown-linux export TARGET=sslittle-na-sstrix export IDIR=~/$NAME cd ~/$NAME tar xvfz $TOOL.tgz rm -rf gcc-2.6.3 cd ~/$NAME tar xvfz $UTIL-990811.tar.gz cd $UTIL-990811 ./configure --host=$HOST --target=$TARGET --with-gnu-as --with-gnu-ld --prefix=$IDIR make CC=gcc sudo make install CC=gcc cd ~/$NAME tar xvfz $SIM-3v0d.tgz cd $SIM-3.0 make config-pisa make CC=gcc cd ~/$NAME tar xvfz gcc-2.

READ MORE

C语言编译的顺序。关于 .c 文件 .h 文件的用法。Makefile文件简单概念。

C语言编译的顺序。关于 .c 文件 .h 文件的用法。Makefile文件简单概念。 C语言编译的顺序。关于 .c 文件 .h 文件的用法。Makefile文件简单概念。 C语言编译链接过程: http://hi.baidu.com/jcbpxdmajtfguxr/item/dbb6b1ada0572c2c8819d34b 編譯器與連結器的基本概念: http://www.csie.nctu.edu.tw/~skyang/concept.zhtw.htm C语言头文件的使用: http://blog.csdn.net/janders/article/details/611081 ============================================= 关于 .c 文件 .h 文件的用法 main.c 1. #include"head_file.h" 2. #include<stdio.h> 3. 4. 5. int main(void){ 6. 7. 8. usr_func(); 9. } usr_func.c 1. int usr_fun(void){ 2. printf("Hello, I'm your usr_function!\n"); 3. 4. 5. } head_file.h 1. #ifndef USR_FUNC 2. #define USR_FUNC 3. 4. 5. int usr_fun(); 6. 7. 8. #endif 把以上3个文件放入project文件夹,build即可,无需在project_properties里面设置include这3个文件中的某些文件。 =================================================== Linux下Makefile文件简单概念 来源: Linux伊甸园 日期: 2008.05.28 16:14 将各个模块的关系写进makefile,并且写明了编译命令,这样,当有模块的源代码进行修改后,就可以通过使用make命令运行makefile文件就可以进行涉及模块修改的所有模块的重新编译,其他模块就不用管了。 makefile文件的写法: 目标, 组件,规则 例如 有下面5个文件: main.

READ MORE

C语言实现FFT算法 - 开发手记

C语言实现FFT算法 - 开发手记 C语言实现FFT算法 - 开发手记 Realize FFT transformation by C language. by Shun Fu, DSP Lab of Northeastern University. In order to do frequency analyze for an input signal, we need to do the DFT transform for the data sampled from our codec(AD/DA). Read more about DFT: http://en.wikipedia.org/wiki/Discrete_Fourier_transform FFT is a more efficiency algorithm for calculating the DFT. Here I don’t describe what is FFT algorithm, you can check it on wikipedia.com Here is a figure explaining the principle of 3 order (N = 2^3 = 8points) FFT algorithm.

READ MORE

linux下kbhit()函数 getch函数。

linux下kbhit()函数 getch函数。 怎样在C语言执行循环程序时按键盘任意键停止程序,再按再继续执行? 参考http://zhidao.baidu.com/question/272086855.html 在linux下C语言写了一个while循环,怎么实现按任意键退出。如何编写程序? 参考:http://zhidao.baidu.com/question/461121586.html 对于上面的问题,都用到 linux下的getch函数与kbhit函数。 参考了http://kpld8888.wordpress.com/2007/03/07/linux%E4%B8%8B%E7%9A%84getch%E5%87%BD%E6%95%B0%E4%B8%8Ekbhit%E5%87%BD%E6%95%B0-2/ 和:http://zhidao.baidu.com/question/461121586.html 但是我照搬上面两条都不能很好的编译,总是有错误。奉上我的文件: 将下列三个文件放在工程目录下,build project即可。 main.c: 1. #include "kbhit.h" 2. #include <stdio.h> 3. #include <stdlib.h> 4. #include "accelerometer.h" //contains the middle level macros, state variable 5. // definition and declaration for the 6. //middle layer (class layer) functions 7. 8. 9. 10. void delay(int a){ 11. int i,j,delay; 12. for(i = 0 ; i < 1170*(200/a); i++){ 13. delay = 0; 14. for(j = 0; j < 100; j++){ 15. delay = delay+1; 16.

READ MORE

MATLAB 3D 动画制作(一、二、三)

MATLAB 3D 动画制作(一)- 3D 图形设计 MATLAB 3D Animation – 3D object design Auther: Sonictl Northeastern University. 前言:本系列教程将逐步完成一个有趣的MATLAB 3D动画,MATLAB 3D图形的绘制和3D动画的制作可以让工程人员很直观地展示工作内容,特别是在虚拟现实,控制系统设计,人机交互,计算机视觉,等领域都能得到应用。 Introduction: This series of tutorials are going to discuss a process of making 3D animation using MATLAB step by step. The 3D animation in MATLAB can let the engineers exhibit their work. It can be used widely, especially at the fields of Virtual Reality, Control system Designing, Human-machine interactivity, Computer Vision, etc. 首先介绍一下本教程的最终效果: Below is the final effect of this 3D animation.

READ MORE

MATLAB 3D 动画制作(三)- 实时随动3D动画设计

MATLAB 3D 动画制作(三)- 实时随动3D动画设计 MATLAB 3D 动画制作(三)- 实时随动3D动画设计 MATLAB 3D Animation – Real-time 3D Animation Design Author: Sonictl Northeastern University. 前言:本教程将逐步完成一个有趣的MATLAB 3D实时随动动画, 本篇将使用串口数据实时控制动画中的物体的运动。“MATLAB 3D 动画制作(三)- 实时随动3D动画设计” 是 “MATLAB 3D 动画制作(二)- 3D 动画动作设计” 的进阶篇。 本篇将使用串口数据实时控制动画中的物体的运动。 Introduction: This series of tutorials are going to discuss a process of making 3D animation using MATLAB step by step. The 3D animation in MATLAB can let the engineers exhibit their work. It can be used widely, especially at the fields of Virtual Reality, Control system Designing, Human-machine interactivity, Computer Vision, etc.

READ MORE

MATLAB 3D 动画制作(二)- 3D 动画动作设计

MATLAB 3D 动画制作(二)- 3D 动画动作设计 MATLAB 3D 动画制作(二)- 3D 动画动作设计 MATLAB 3D Animation – 3D Animation Action Design Auther: Sonictl Northeastern University. 前言:本系列教程将逐步完成一个有趣的MATLAB 3D动画,MATLAB 3D图形的绘制和3D动画的制作可以让工程人员很直观地展示工作内容,特别是在虚拟现实,控制系统设计,人机交互,计算机视觉,等领域都能得到应用。 MATLAB 3D 动画制作(二)- 3D 动画动作设计 是 MATLAB 3D 动画制作(一)- 3D 图形设计 的进阶篇。 Introduction: This series of tutorials are going to discuss a process of making 3D animation using MATLAB step by step. The 3D animation in MATLAB can let the engineers exhibit their work. It can be used widely, especially at the fields of Virtual Reality, Control system Designing, Human-machine interactivity, Computer Vision, etc.

READ MORE

MATLAB 3D 动画制作(一)- 3D 图形设计

MATLAB 3D 动画制作(一)- 3D 图形设计 MATLAB 3D 动画制作(一)- 3D 图形设计 MATLAB 3D Animation – 3D object design Auther: Sonictl Northeastern University. 前言:本系列教程将逐步完成一个有趣的MATLAB 3D动画,MATLAB 3D图形的绘制和3D动画的制作可以让工程人员很直观地展示工作内容,特别是在虚拟现实,控制系统设计,人机交互,计算机视觉,等领域都能得到应用。 Introduction: This series of tutorials are going to discuss a process of making 3D animation using MATLAB step by step. The 3D animation in MATLAB can let the engineers exhibit their work. It can be used widely, especially at the fields of Virtual Reality, Control system Designing, Human-machine interactivity, Computer Vision, etc. 首先介绍一下本教程的最终效果: Below is the final effect of this 3D animation.

READ MORE

MATLAB 3D 动画简单实例

MATLAB 3D 动画简单实例 MATLAB 3D 动画简单实例 翻译自网站: http://www.matrixlab-examples.com/simple-animation-3d.html 本文是在系统学习MATLAB绘图(2D-3D)之前的一个引例。 系统学习资料在: MATLAB 2-D and 3-D 绘图 望喜欢! 本文将展示2个使用MATLAB制作的简单的3D动画。在第一个例子中,我们对一个球体sphere进行动画制作,旋转了观察的角度,但没有改变物体形状。 在第二个例子中,我们画了一个抛物面paraboloid,并且改变了它的大小和形状。这些简单的技术是MATLAB动画制作的基础。 1. 球体的动画 首先我们绘制了一个球体,并且保证3D坐标系的比例是正常的。然后,变换我们观察的角度,从方位角和高度进行了改变。整个过程不改变球体形状大小,只是改变视角。 ‘drawnow’语句作用就是更新当前的图形。它冲掉了queue事件,强行让MATLAB更新屏幕。 完成以上功能的代码如下: clear; clc; close all % Draw a sphere sphere % Make the current axis box square in size axis('square') % Define title and labels for reference title('Rotation of a sphere...') xlabel('x'); ylabel('y'); zlabel('z') % Modify azimuth (horizontal rotation) and update drawing for az = -50 : .2 : 30 view(az, 40) drawnow end % Modify elevation (vertical rotation) and update drawing for el = 40 : -.

READ MORE

MATLAB 3D 动画简单实例

MATLAB 3D 动画简单实例 MATLAB 3D 动画简单实例 翻译自网站: http://www.matrixlab-examples.com/simple-animation-3d.html 本文是在系统学习MATLAB绘图(2D-3D)之前的一个引例。 系统学习资料在: MATLAB 2-D and 3-D 绘图 望喜欢! -—————– 本文将展示2个使用MATLAB制作的简单的3D动画。在第一个例子中,我们对一个球体sphere进行动画制作,旋转了观察的角度,但没有改变物体形状。 在第二个例子中,我们画了一个抛物面paraboloid,并且改变了它的大小和形状。这些简单的技术是MATLAB动画制作的基础。 球体的动画 首先我们绘制了一个球体,并且保证3D坐标系的比例是正常的。然后,变换我们观察的角度,从方位角和高度进行了改变。整个过程不改变球体形状大小,只是改变视角。 ‘drawnow’语句作用就是更新当前的图形。它冲掉了queue事件,强行让MATLAB更新屏幕。 完成以上功能的代码如下: -————————– clear; clc; close all % Draw a sphere sphere % Make the current axis box square in size axis('square') % Define title and labels for reference title('Rotation of a sphere...') xlabel('x'); ylabel('y'); zlabel('z') % Modify azimuth (horizontal rotation) and update drawing for az = -50 : .2 : 30 view(az, 40) drawnow end % Modify elevation (vertical rotation) and update drawing for el = 40 : -.

READ MORE