Linux or Unix 模拟环境安装方法

来源:互联网 发布:淘宝优惠券使用方法 编辑:程序博客网 时间:2024/06/05 20:57
General lab FAQ, tips, tricksAre questions and feedback from the students welcome?Questions from the students are very welcome. The lab assistants are busy people, but they try their best to improve the labs and to help students. If you have questions, do not hesitate to ask. Your questions may be useful for other students and in this case they will be posted on the FAQ. However, before contacting the lab assistants please look through the FAQ to see if you can find help here. But of course, if you are reading this page you are already aware of this. Also, it may sometimes be useful for you to try to solve the small problems you encounter on your own. One of the most important skills of engineers is problem solving, and once you will be in a working environment there won't be lab assistants around helping you when you are in need...Do not hesitate to send feedback also. Your feedback can improve the course, at least for the next generations of students.Can I work from home? What is the recommended solution?Yes, you can! If you want to work on your own computer, you will need to have an Xserver and an ssh client.If you have a Mac/Linux/Unix system, the software you need will most likely already be present in the system. If the Xserver or the ssh client is not present, refer to the documentation of your operating system for instructions on how to install these components. If you have a Windows system, you will need to install an Xserver and an ssh client. There are many different solutions, but the recommended solution is to install Linux on your machine in a dual-boot environment. Alternatively, you can install Cygwin, a Unix environment that works from within Windows. How can I install Linux on my machine?There are many Linux distributions available and you can use any. Most distributions come bundled with the ssh client and Xserver, if not you will need to install them. If you have a Windows system, unless you want to get rid of Windows, you may consider setting up a dual-boot system. The less painful way and safest way to make Linux coexist peacefully with your Windows environment is probably to install the Ubuntu Linux distribution via wubi, the Windows-based Ubuntu installer. You can download wubi from www.wubi-installer.org. You do not need to download the Ubuntu ISO, you only need to download the wubi installer from your Windows environment and to launch it. The installer will automatically download the Ubuntu ISO and install Ubuntu on your system. You do not need to have a dedicated partition for Linux, Ubuntu will be installed in your Windows filesystem. At reboot, you will be prompted whether you want to boot into Windows or into Ubuntu. It is possible to disinstall Ubuntu from the standard Windows installer in the control panel at any time. At least 5 GB of free disk space are recommended for Ubuntu to work properly. Ubuntu comes bundled with an ssh client and an Xserver, so you will not need to install any additional components.How can I install Cygwin? What plugins do I need?You can get Cygwin from http://www.cygwin.com. You need to install two packages along with cygwin to be able to connect to the KTH servers:in the NET packages you need ssh in the X11 packages you need X11baseDo not deselect any package needed by these packages, they will be automatically selected when you choose ssh and X11base.I have installed Cygwin. How can I connect to the server?Launch Cygwin. Run the command "startx" (or "startx.exe") to start an X11 (graphical) server and to launch a graphical terminal. A graphical terminal will pop up. You can use it to issue the command "xhost +" (or "xhost.exe +"), which will allow the xserver to accept connections from any host. Once that command is issued, you can connect to the KTH server with the command "ssh -Y username@servername.it.kth.se". Remember to specify your username before the servername. If you connect from the labs, this is not needed because the username you use in the labs is the same as the one used to connect to the servers. But if you are connecting from home, this is probably not the case and you need to specify your username too.Once logged in the servers, I am having problems accessing the commands reported in the lab manual. What is the problem?If you get errors when you try to run commands such as emacs or wget, you probably have wrong settings in your .bashrc file. There are three variables that must be set by this file in order for you to able to run the commands needed for the lab manual:The variable PATH should be set to the value"/afs/it.kth.se/pkg/gcc/3.0.3/os/bin:/opt/gnu/emacs/20.7/bin: /opt/lang/egcs/bin:/opt/gnu/bin:/opt/local/kde1.1.1/bin: /afs/it.kth.se/opt/commercial/netscape/communicator-4.73: /usr/heimdal/bin:/opt/local/heimdal/latest/sbin:/usr/afsws/bin: /usr/bin:/bin:/usr/sbin:/sbin:/afs/it.kth.se/pkg/cadence/ius/6.2/os/tools/bin: /afs/it.kth.se/pkg/matlab/7.0.4/os/bin:/usr/openwin/bin".The labs have been tested with this PATH, which should contain the paths to all the executables needed for the labs. The variable LM_LICENSE_FILE should be set to the value "@lic2.sys.it.kth.se" The variable TERM should be set to the value "xterm"To set these three variables at the end of your .basrhc file you can issue, while logged at xenon with your username:echo "export PATH=/afs/it.kth.se/pkg/gcc/3.0.3/os/bin:/opt/gnu/emacs/20.7/bin: /opt/lang/egcs/bin:/opt/gnu/bin:/opt/local/kde1.1.1/bin: /afs/it.kth.se/opt/commercial/netscape/communicator-4.73: /usr/heimdal/bin:/opt/local/heimdal/latest/sbin:/usr/afsws/bin: /usr/bin:/bin:/usr/sbin:/sbin:/afs/it.kth.se/pkg/cadence/ius/6.2/os/tools/bin: /afs/it.kth.se/pkg/matlab/7.0.4/os/bin:/usr/openwin/bin" >> ~/.bashrc echo "export LM_LICENSE_FILE=@lic2.sys.it.kth.se" >> ~/.bashrc echo "export TERM=xterm" >> ~/.bashrc Note that you cannot copy-paste these commands into the shell because extra spaces have been inserted in order for this page to look nice. Delete these spaces before copy-pasting or copy-paste the commands from this text file. After editing your .bashrc file, remember that you have to login and logout before the changes take effect. After logging in again in your account, you should be able to run all the commands needed to complete the labs.I get permission errors when I try to edit my .bashrc file. What can I do?Issue "chmod 777 ~/.bashrc". Then permissions should be fine if you try again to edit the file.Should I login to xenon or to herkules?The best is if the load of students in the two servers are balanced. Once you log in a server, you can run the command "finger" to see how many people are logged in the server. Keep the load balanced and the simulation times will be better for everybody.I don't like emacs, I want to edit files on my local windows machine. Is it possible?yes it is! If you have a windows machine, then you can install winscp to transfer files (through scp) from your local machine to the KTH servers and viceversa.On your machine, you can edit files with any editor you like. If you do not like the default editors of your system, you may try to take a look at context editor or at jedit (both freely available).Can I use Modelsim instead of NCSim?Yes, you can, as long as you are able to perform all the tasks that are requested in the lab manuals. The labs have been tested with NCSim, and support for SystemVerilog is supposed to be better in NCSim than in Modelsim, but if you are able to perform all the tasks in Modelsim the labs will be accepted.How can I have my labs checked?You come to a lab session, you call the lab assistant, he will come and check your labs at your computer. He will ask you some questions to check that you have really understood the lab and not just copied it from somewhere. If you are two people in a group, the lab assistant will ask questions to both of you, to check that both the members of the group have worked. When you have completed some tasks, call the lab assistant and he will check your lab. Please avoid calling the lab assistant each time you complete one or two tasks, it is better if you wait until you have many tasks to show. Also, make sure everything works before calling the lab assistant, lab assistants do not like to waste their time...Why can't I call the file editor (emacs) from within NCLaunch when I right-click on a source file and select "Edit"?Open the menu "Edit"->"Preferences" in NCLaunch, in the "Editor Command" textbox write "emacs". Click "OK" and it will work.Using NCLaunch/NCSim makes me click so much! My fingers are in pain! What can I do?(Note: this is, by very very far, the most frequently asked question of all!) There is something you can do: First of all, when you edit your files, you do not need to go through all the steps (compilation/elaboration) once you have a compiled snapshot. What you need to do is just to update it. To update a snapshot that depends on one or more source files that have been modified, you can right click on the elaborated snapshot and select "update". Accept the defaults. The files that have been modified after the snapshot was last obtained will be compiled, if elaboration needs to take place it will take place. When the commands complete, the snapshot will be up-to-date. And you will have clicked only twice instead of many many times!Another problem is when people run NCSim. Many windows open and to run another simulation they must all be closed. However, if you do not need to check waveforms you do not need the graphical interface of NCSim (SimVision). You can run the simulation in interactive (console) mode, it has the same functionality as the GUI version, but it loads much faster and you will have only one window to close. To be able to run NCSim in interactive mode, you need to check that you have in your PATH variable the path "/usr/openwin/bin" (issuing "echo $PATH" will print the PATH variable on the console). If "/usr/openwin/bin" is not in the PATH, you can add it by issuing the command: echo "export PATH=$PATH:/usr/openwin/bin" >> ~/.bashrcRemember to logout and login again after issuing the command or it will not have any effect.Now, when you want to simulate a snapshot in interactive mode, you can just right click on it from NCLaunch, select "NCSim...", in the popup window select "interactive mode" in the "Run mode" field. NCSim will run in a terminal, you can launch the simulation with the command "run" ("run t" will run the simulation for t time units).When I launch Matlab, I get some errors/warnings about search path. Then matlab does not recognize some commands. What can I do?Do as suggested in the errors you get: run "restoredefaultpath; matlabrc" in the matlab prompt. The commands should fix the problem.wget and other commands do not work in xenon.it.kth.se. What should I do?As of March 27th, 2009, xenon is experiencing strange behavior after the IT service has reinstalled the software on the server. Some commands such as wget have stopped to work. You can log in in herkules.it.kth.se instead of xenon, and use wget from there. The files will then be accessible both when you log in xenon and herkules, because your home directory is the same in both systems. Alternatively, you can use the Unix command scp from a Linux/Mac machine to copy files from your machine to the servers or winscp to do the same under windows.I cannot understand what is the difference between logic and wires. Help!Don't worry, it is normal, wires are one of the most tricky concepts of Verilog/SystemVerilog for beginners or people migrating from VHDL. However, the concept will come simple and natural when you understand it. You may want to take a look at this page on Verilog and this page on SystemVerilog. Remember that reg in Verilog was renamed logic in SV, with some slight modifications (it is possible to declare a wire logic in SV but not a wire reg in Verilog).To summarize, SV has variables and nets. A data type such as logic can be declared either as a variable (using the keyword var) or as a net (using the keyword wire). If both keywords are omitted, the declaration defaults to a variable.in SystemVerilog a variable may represent combinatorial or sequential elements. A variable can be written to by always or initial blocks. In comparison, a net can never be written to by an always or initial block and cannot represent sequential elements. Nets represent physical interconnections. In a module, an input port must always be declared as a net. If a module is instatiating different submodules, all output ports of these submodules must be connected to nets in the parent module. nets, but not variables, can be assigned by continuous assignments because continuous assignments are only a shorthand way to define physical structure (writing "assign a = b & c" is equivalent to instantiate an "and" submodule, and since the output of a submodule must be connected to a net in the parent module, a must be declared as a net).
原创粉丝点击