特权和你一起学NIOS2 第一章
niosii IDE提示make

niosii IDE提示make: *** [ .elf] Error 1或者 make: *** [**.elf] Error 1我的系统是WIN7,QuartusII和NIOS2的版本都是10.0,按照特权同学的《特权和你一起学NIOS2--第三章流程实践案例——手把手第一个工程》操作,前面都很顺利,后来在Eclipse里建好了软件工程之后,编译(Build Project),出现如下错误提示:make:***[**.mk] Error 1 或者make: *** [**.elf] Error 1。
看了很多论坛,很多网友都提了自己的解决思路,归纳起来,大概有几种解决办法:(1)、Regenerate the BSP to update the Makefile, and then build again. To r egenerate from Eclipse: 1. Right-click the BSP project. 2. In the Nios II Menu, click Generate BSP.(2)、Here is the list of files that you can select to change their compatibilit y mode under the Quartus II->bin->cygwin->bin folder:1. Make.exe2. Sh.exe3. Echo.exe4. Cygstart.exe5. MakeInfo.exe6. Perl.exe7. Collect2.exe (under nios2eds\bin\nios2-gnutools\ H-i686-pc-cygwin\libexec\gcc\ nios2-elf\3.4.6)8. Nios2-elf-g++.exe (under nios2eds\bin\nios2-gnutools\ H-i686-pc-cygwin\bin)方法就是将上面8个.exe文件改成XP兼容模式。
上海版牛津英语9A Unit 3教案 (5课时,含教后感)

Unit 3 Head to headPeriod 1 Vocabulary and backgroundPeriod OneTeaching aims1.Learn the new words and phrases.2.Knowing the background of the text3.Getting familiar with the text.4.Improving students`abilities to learn new words and phrasesBy asking and answering the questions.Teaching materials1Multi-media2Exercise sheetsTeaching ProcedureStep 1Introduce some backgrounda)What do you know about animals and pets? (Let Ss know some knowledge of pets.)Notes:1.Most dogs live between 8 and 14 years, depending on the breed, their health andTreatment by owners.2. It is easy to overfeed fish, and this may kill them.3. Lizards are mostly harmless. They should not be confused with snakes. Lizards havelegs; snakes do not.4. Birds sing for various reasons, as far as we know. Some bird-songs are mating, forWarning, for marking territory and so no. We should be aware that we may be attachinghuman emotions and reasons to animals and birds incorrectly. We do often sing whenwe are happy, but that does not necessarily mean that birds are happy when they sing.5. It is widely believed that dogs wag their tails from side to side when they are friendly orpleased with something . Cats, on the other hand, do seem to wag their tails when theyare angry or upset.6. The size of a dog does not mean that it is more or less friendly. However, many peopleare more afraid of larger animals. Some very small dogs be aggressive; some large dogsare very gentle. The breed of the dog and the kind of treatment it has had in its life ismore important than its actual size.b) Tell the sentences about dogs “T” or “F”1. Most dogs can only live for about three years.2. You must not give pet fish lots of food.3. All lizards are poisonous and can kill you.4. In nature, birds only sing when they are happy.5. When a dog moves its tails from side to side , it is happy6. Big dogs are more dangerous than little dogsStep 2Teach some new wordsa)Talk about dogs according to the given questions.(Let Ss say some their ownopinions and they can do pair work for them)1.Can we teach dogs to do things fro people?2.Are all the dogs in the same size?3.Are dogs allowed to live in large open spaces?4.If dogs live in small spaces, how will they feel?5.Do dogs like to be often washed?6.Why do we say dogs are our best friends?b)Get familiar with the new words and phrases (Read together, and remember them)Cute extremely train faithfully responsibilityCare for grow up regularly choice in one`s opinionc) Teach some other words through pictures and paraphrases➢.cute – beautiful, lovely➢Extremely – very➢Train – teach➢Grow up – develop➢Regularly – often➢In my opinion – I thinkd)Fill in the blanks to master the new wordsa)Dogs are really ____________.b)This may make the dogs feel _____________ unhappy.c)We can learn about _________ from keeping pet dogs.d)Pet dogs create a lot of mess and they need to be washed regularly.e)We have to feed them, ________them and play with them.f)In my _________, it is never a good idea to keep a pet dog.g) A dog will love you _______ for many years.h)According to my mum, this helps us become more _________ people.i)Young people can learn how to _______ ______ others.j)It`s wonderful to see them ______ ________ quickly.Step 3Ask students to do some exercises to consolidate what they have learnt todaya)Listen to the sentences and fill in the blanksb)Get familiar with the text by dividing the sentences into two groups1.Keeping pet dogs is a good idea.2.It`s not a good idea to keep pet dogs.c)Get the meaning of the expression”Head to head” and know the background of the text.Is it a good idea to keep pet dogs?Emma says that keeping pet dogs is a good idea. Pet dogs are c_______, and it`swonderful to see them g________ up. We can learn about r______ from keeping pet dogs because we have to feel them, t______ them and play with them. We can also learn how to c_______ for others by keeping pet dogs. Pet dogs create mess both inside and outside.We should wash them r_______. Not all dogs are f__________. Some dogs bark at people they do not know. In modern cities most people live in flats. They have no c_______ but to keep their dogs in small spaces. This may make the dogs feel e______ unhappy. And paying for dog food can be expensive.Homework1. Students`book 9A Page 20 Exercise A,B2. Copy new words and expressions3. Read the text and give your opinion about“Is it a good idea to keep pet dogs?”Unit 3 Head to headPeriod 2 ReadingPeriod TwoTeaching aims5.To understand different views of raising pets.6.To develop their skills with the focus on prediction and summarizing.7.To express their opinions with proper supporting details.8.To write an essay based on the outlineTeaching materials3Multi-media4Exercise sheetsTeaching ProceduresStep 1Brainstorm (adjectives on describing pets)Ask questions on students’ different views or habits of keeping pets. Step 2 Understand the titleShow the title of the article and ask the students if they understand it. Step 3 Reading1. Read the first part and get the main idea2. Ask the students to read through what Emma says about keeping petdogs.3. Read the first part again and complete the chart.4. Predict Matt’s views. Ask the students to guess Matt’s views aboutkeeping pet dogs.5. Read the second part and get the main idea. Ask the students to readthrough what Matt says about keeping pet dogs.6. Read the second part again and judge the statements. Ask thestudents to further read what Matt says.7. Complete a report to summarize the article. Have the studentscomplete a report.8. Make an outline. Outline the structure of the article and then ask thestudents to find out the useful words.Step 4 Have a debateConduct a debate on the topic’ Electronic/Real dogs are better.’HomeworkOral work: Read and recite the article.Written work:1. Answer the questions according to the article.2. Write an essay on the topic ‘I’d like to keep an electronic dog/a real dog asa pet ’.教后记:课文中两个人物对养宠物狗提出了不同的观点,通过本课的学习后,同学们也各持己见进行了热烈的讨论。
特权同学倾情奉献9G海量FPGA学习资料

特权同学倾情奉献9G海量FPGA学习资料
本人最恨恶淘宝上那些卖资料的JS了,本来就是网络上免费搜集来的资料,居然还冠冕堂皇的拿来生财。
为此,本人特别将手上所有的资料共享给广大的FPGA爱好者们。
百度网盘下载地址:
/s/1o62lMYY
《深入浅出玩转FPGA》视频教程:35课时
特权同学精心录制的35课时深入浅出FPGA入门、进阶课程。
可配套北航出版社2010年6月上市的《深入浅出玩转FPGA》一书学习。
整部视频先是阐述FPGA的基本概念和学习方法,接着通过相应的开发套件BJ-EPM和SF-EP1C进行实践学习。
是初学者迈入
《特权和你一起学NIOS2》视频教程:20课时
特权同学的又一力作,SOPC的设计与底层逻辑设计不同,这部教程完全以另一种方式带领初学者领悟基于FPGA的嵌入式系统设计,同时也希望借助本教程能使大家熟悉在EDS 软件平台上实现NIOS2的编程和开发。
与本视频完全配套同步的图书《爱上FPGA开发——
Altera官方专题视频教程:38课时
特权fpga技术公开课
Altera官方资料(各类手册和应用笔记)(略)
百度网盘下载地址:
/s/1o62lMYY。
海量FPGA资料下载链接

开发套件SF-EP1C FPGA开发套件相关例程和文档/lib/detail.aspx?id=88172 /lib/detail.aspx?id=88173 /lib/detail.aspx?id=88174 /lib/detail.aspx?id=88175 /lib/detail.aspx?id=88176 /lib/detail.aspx?id=88177 /lib/detail.aspx?id=88178 /lib/detail.aspx?id=88179 /lib/detail.aspx?id=88180 /lib/detail.aspx?id=88181 /lib/detail.aspx?id=88182 /lib/detail.aspx?id=88183 /lib/detail.aspx?id=88184 /lib/detail.aspx?id=88185 /lib/detail.aspx?id=88186 /lib/detail.aspx?id=88187 /lib/detail.aspx?id=88188 /lib/detail.aspx?id=88189 /lib/detail.aspx?id=88190/lib/detail.aspx?id=88191/lib/detail.aspx?id=88192 /lib/detail.aspx?id=88193 /lib/detail.aspx?id=88194 /lib/detail.aspx?id=88195 /lib/detail.aspx?id=88196 /lib/detail.aspx?id=88197 /lib/detail.aspx?id=88198 /lib/detail.aspx?id=88199/lib/detail.aspx?id=88200/lib/detail.aspx?id=88201 /lib/detail.aspx?id=88202 /lib/detail.aspx?id=88203 /lib/detail.aspx?id=88204 /lib/detail.aspx?id=88205 /lib/detail.aspx?id=88206 /lib/detail.aspx?id=88207 /lib/detail.aspx?id=88208 /lib/detail.aspx?id=88209 /lib/detail.aspx?id=88210 /lib/detail.aspx?id=88211 /lib/detail.aspx?id=88212 /lib/detail.aspx?id=88213 /lib/detail.aspx?id=88214 /lib/detail.aspx?id=88215 /lib/detail.aspx?id=88216 /lib/detail.aspx?id=88217 /lib/detail.aspx?id=88218 /lib/detail.aspx?id=88219 /lib/detail.aspx?id=88220 /lib/detail.aspx?id=88221/lib/detail.aspx?id=88223 /lib/detail.aspx?id=88224 /lib/detail.aspx?id=88225 /lib/detail.aspx?id=88226 /lib/detail.aspx?id=88227 /lib/detail.aspx?id=88228 /lib/detail.aspx?id=88229 /lib/detail.aspx?id=88230 /lib/detail.aspx?id=88231 /lib/detail.aspx?id=88232 /lib/detail.aspx?id=88233 /lib/detail.aspx?id=88234 /lib/detail.aspx?id=88235 /lib/detail.aspx?id=88236 /lib/detail.aspx?id=88237 /lib/detail.aspx?id=88238 /lib/detail.aspx?id=88239 /lib/detail.aspx?id=88240 /lib/detail.aspx?id=88241 /lib/detail.aspx?id=88242 /lib/detail.aspx?id=88243 /lib/detail.aspx?id=88244 /lib/detail.aspx?id=88245 /lib/detail.aspx?id=88246 /lib/detail.aspx?id=88247 /lib/detail.aspx?id=88248 /lib/detail.aspx?id=88249 /lib/detail.aspx?id=88250 /lib/detail.aspx?id=88251 /lib/detail.aspx?id=88252 /lib/detail.aspx?id=88253 /lib/detail.aspx?id=88254/lib/detail.aspx?id=88255/lib/detail.aspx?id=88256 /lib/detail.aspx?id=88257 /lib/detail.aspx?id=88258 /lib/detail.aspx?id=88259 /lib/detail.aspx?id=88260 /lib/detail.aspx?id=88261/lib/detail.aspx?id=88262/lib/detail.aspx?id=88263 /lib/detail.aspx?id=88264 /lib/detail.aspx?id=88265/lib/detail.aspx?id=88111 /lib/detail.aspx?id=88112 /lib/detail.aspx?id=88113 /lib/detail.aspx?id=88114 /lib/detail.aspx?id=88115 /lib/detail.aspx?id=88116 /lib/detail.aspx?id=88117 /lib/detail.aspx?id=88118 /lib/detail.aspx?id=88119 /lib/detail.aspx?id=88120 /lib/detail.aspx?id=88121无无/lib/detail.aspx?id=88122 /lib/detail.aspx?id=88123 /lib/detail.aspx?id=88124 /lib/detail.aspx?id=88125 /lib/detail.aspx?id=88126 /lib/detail.aspx?id=88127 /lib/detail.aspx?id=88128 /lib/detail.aspx?id=88129 /lib/detail.aspx?id=88130 /lib/detail.aspx?id=88131 /lib/detail.aspx?id=88132 /lib/detail.aspx?id=88133 /lib/detail.aspx?id=88134 /lib/detail.aspx?id=88135 /lib/detail.aspx?id=88136 /lib/detail.aspx?id=88137 /lib/detail.aspx?id=88138 /lib/detail.aspx?id=88139 /lib/detail.aspx?id=88140 /lib/detail.aspx?id=88141/lib/detail.aspx?id=88145 /lib/detail.aspx?id=88146 /lib/detail.aspx?id=88147 /lib/detail.aspx?id=88148 /lib/detail.aspx?id=88149 /lib/detail.aspx?id=88150 /lib/detail.aspx?id=88151 /lib/detail.aspx?id=88152 /lib/detail.aspx?id=88153 /lib/detail.aspx?id=88154 /lib/detail.aspx?id=88155 /lib/detail.aspx?id=88156 /lib/detail.aspx?id=88157 /lib/detail.aspx?id=88158 /lib/detail.aspx?id=88159 /lib/detail.aspx?id=88160 /lib/detail.aspx?id=88161 /lib/detail.aspx?id=88162 /lib/detail.aspx?id=88163 /lib/detail.aspx?id=88164 /lib/detail.aspx?id=88165。
NiosII CPU的结构与编程模型

NiosII CPU的结构与编程模型NiosII CPU属于典型的RISC CPU,其特点是:结构简洁、指令集简练、指令等长、具有大量的通用寄存器。
下图为NiosII的结构框图。
NiosII CPU由若干基本模块和一系列可选模块构成。
基本模块包括:ALU、程序控制器、地址发生器、中断控制器、寄存器组等;可选模块有:Jtag调试器、用户指令逻辑、指令Cache、数据Cache等。
NiosII 共有39个工作寄存器,包括32个通用寄存器,5个控制器存器,1个CPUID寄存器、1个PC指针寄存器,每个寄存器都是32位的寄存器,都可以做32位的操作。
NiosII的32个通用寄存器,除R0外都可做为累加器进行各种算术、逻辑运算。
R0 为0值寄存器,对其进行读操作返回值是0,写操作对其没有影响,这一寄存器在指令集中有特殊的应用。
R24是中断处理程序专用寄存器,它是给中断处理程序专用的,虽然在用户程序中许访问,但不要用来保存数据,因为其中数据有可能被中断处理程序覆盖掉。
同样,R25是调试代理专用寄存器,也不要在用户程序中使用。
R29是PC指针的中断堆栈寄存器,当有中断发生时,这一寄存器用来保留一个返回地址,以便从中断处理程序返回到被中断的程序。
R30是PC指针的断点堆栈寄存器,用于系统调试。
当程序运行过程中遇到断点,这一寄存器中保留一个返回地址,以便从调试代理程序返回。
R31是PC指针的调用堆栈,用于子程序调用。
执行子程序调用指令时,这一寄存器中保留返回地址,以便从子程序返回。
R26、R27、R28在C开发系统中付予了一些特殊的应用,其中R27被作堆栈指针。
NiosII 有5个控制寄存器和一个CPUID寄存器。
Ctl0是程序状态字,目前只有BIT0、BIT1两位是有效的,高30位保留。
BIT0是全局中断控制位,用于中断的全局管理,1为允许,0为禁止。
BIT1是工作模式控制位。
当这一位为1时,系统工作于用户模式,当其为0时,系统工作于管理模式。
Unit 2 School Life Reading Club七年级英语上册(北师大版2024)

Wang Mei's Diary
7th October,2013 我的生活现在大不一样了!我在西河中心学校上学。 有新的课桌和我教室里的椅子,还有我们有一个老 师每一个主题。学校在一个大城市,离这里很远我 的村庄,但没关系。我平日在学校睡觉周末回家。 我在这里有很多朋友。太好了!
Wang Mei's Diary 1 How is Wang Mei's new school different from her old one? How can Project Hope help children likeWang Mei?
Check Your Progress Complete Peter's and Grace's comments about their school life with the correct form of the words in brackets.
Hi, I'm Peter. There are 30 1 _______(student) in my class. They are from four different 2 _______(country). We have got different school 3 ________(life). Some do lots of after-school activities. Some study a lot. But we are all friends and we enjoy our 4_______(lesson).
In what ways is Glasgow School of Sport similar to and different from
Lesson 7 NIOS2软件开发平台EDS简介

LESSON 7
NIOS2软件开发平台EDS简介
《特权和你一起学NIOS2》 特权制造
软件开发的一些基本概念
《Nios II Software Developer’s Handbook.pdf》 Section I: Overview ● Nios II Software Development Environment ● Nios II EDS Development Flows ● Nios II Programs (Nios II Software Project Types)
《特权和你一起学NIOS2》 特权制造
本课时结束,谢谢支持!
欢迎加入/1375/共同学习探讨
欢迎加入/1375/共同学习探讨
《特权和你一起学NIOS2》 特权制造
HAL(硬件抽象层)的一些基本概念
《Nios II Software Developer’s Handbook.pdf》 Section II: Overview of the Hardware Abstraction Layer ● Getting Started ● HAL Architecture ● Supported Hardware
欢迎加入/1375/共同学习探讨Leabharlann 特权和你一起学NIOS2》 特权制造
EDS工具界面简介
● 菜单栏/快捷工具栏 ● 项目浏览窗口 ● 任务栏/问题栏/控制台 ● 其它
欢迎加入/1375/共同学习探讨
2022年乡教育办公室教育工作半年总结范文及今后打算

2022年乡教育办公室教育工作半年总结范文及今后打算半年来,在各级领导的关心支持下,我乡教育突出教育教学质量的中心地位,标准管理,创新奋进,教育呈现出良好的开展态势。
现将半年以来的教育工作总结如下:我乡第一初级中学教学楼建设工程正在建设中,认真做好了教学楼开工建设的前期准备工作,并经有关部门立项,设计院人员现场勘查规划设计,制定了建设方案和图纸,取得了教学楼建设工程规划许可证;做好地质勘探并形成地质勘查报告;对该工程的工程施工进行公开招标,完成教学楼建设工程施工许可证等手续的办理,形成了监理等文件。
工程总投资150万元,资金已全部到位。
该教学楼设计为四层框架结构,东西走向。
总建筑面积1980平方米,建成后将容纳16个教学班。
在该工程的施工过程中,严格按照国家校舍平安质量标准施工,建设工期从2022年12月至2022年8月。
目前存在的主要问题是,开始施工中发现教学楼西部地基深达10米,工期将受到影响,在保证工程质量的同时建筑公司正加赶工期,力争8月底完工,2022年暑假后建成并投入使用。
现在四层楼体已完工,近期将封顶。
我乡第一初级中学的教学楼新建工程正在建设中,严格工程质量关,催促工程按时完工。
现在教学楼地基已全部完工。
一楼主体正在建设中。
争取我乡中心小学新建工程开工,同时完成中心幼儿园建设。
积极开展我乡素质教育活动。
我乡组织中小学生参加新泰市春季,取得了较好成绩,获得泰安市教育局体育工作先进单位荣誉称号。
乡党委政府高度重视幼儿园布局调整工作,清理幼儿园非法办园,共清理非法办园10处。
今年东邱幼儿园已通过泰安市标准化幼儿园验收。
岔河、东峪幼儿园也要争取泰安市级验收。
积极参加上级组织的各项活动。
包括班主任、体育教师、幼儿教师、幼儿园园长、校长培训。
各科优质课评选以及上级组织的研讨会等。
积极迎接视导检查,力争通过新泰市级“三层三步”课堂教学验收合格。
学校校舍平安检查中,现在已完成平安检查整改的落实工作,取得了良好效果。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
特权和你一起学NIOS2欢迎加入EDN FPGA/CPLD助学小组共同交流学习:/1375/ 本教程仅适用于特权制造的SF-NIOS2 FPGA开发板,转载请注明出处!第一章海阔天空聊概念虽然这个教程的大标题美名其曰“特权和你一起学NIOS2”,但是更确切的说应该称之为“特权和你一起学SOPC”。
之所以用NIOS2替代SOPC,其实只是因为SOPC的概念着实有些大了,而NIOS2是全球两大FPGA厂商之一的Altera公司为他们的SOPC系统架构量身打造的软核处理器。
咱比较厚道,就小不就大,只能给个小名“NIOS2”了。
CPU之软核与硬核既然说到了处理器,而且还给它戴了个“软核”的帽子,那么就不能让这个帽子戴得不明不白。
说概念咱就要说得清清楚楚,特权同学在本章的目标是扫盲,所以大家别嫌我啰嗦,如果你觉得都是废话,证明你的等级够高,那么请无视这些啰嗦的叙述,直接跳到下一章是个不错的选择~-~。
好了,说正紧的。
处理器,不懂电子的也知道电脑的CPU中文名也叫处理器,而咱们做嵌入式这一行的就不能够让处理器一词仅仅局限于“CPU”了。
从最简单的51单片机来看,它也算是一个包含了“CPU”的“MCU”(Micro Controller Unit)),其实非要寻根问底搞清楚MCU为何物的话,我还是喜欢拿大家熟悉的PC机来做比方。
一台PC机,有CPU(大家都知道它是大脑)、有硬盘(存储海量的数据)、有内存(暂时存放数据的地方,高速运转的处理和运算都要靠它,操作系统跑起来还是有赖于它的)、有电源、有显卡、有键盘鼠标等等,当然还有一些乱七八糟的外设了,如光驱啊、音箱啊、USB口啊、串口啊、并口啊,总之是五花八门应有尽有。
而这个小小的MCU哪怕是DIP40封装的“大家伙”也只是食指大小,可别看它小,它可是“麻雀虽小、五脏俱全”,它其实在芯片家族中不算小,但比起那个动辄上千个“脚脚”的电脑CPU和那个庞大的机箱来,可真算得上是“迷你精致”了。
拿它和PC比还真不能比性能,咱们要比概念。
但凡用过MCU的同志们都知道它的“强大”,它不仅能够跑程序做运算和控制(处理器),而且能够存程序和数据(ROM和RAM,堪比硬盘和内存),当然也有一些简单的外设了,常见的如GPIO、串口、定时器、看门狗,强大一点的集成USB口、网口甚至一些奇形怪状特权叫都叫不上来的接口。
那么,你现在应该明白MCU是什么了吧?啊,说完这些发现还没有谈论CPU是什么。
CPU就是处理器,处理器就是Central Process Unit,Central Process Unit就是中央处理单元,中央处理器就是能够跑程序的一颗芯片而已,哈哈,没把你绕晕吧。
CPU上面可以跑程序,程序可以做很多事,你可以做一个运算,实现各种各样的复杂算法;你也可以写一段驱动,控制各种各样的外围设备。
总之,人脑可以想到的事,绝对都是CPU可以办到的事。
这么说,知道CPU的powerful了吧。
说完CPU,再说为什么是“软核CPU”,是不是也有“硬核CPU”呢?答案是肯定的,通常大家看到的CPU都是指一些芯片制造商完全定制好强大运算功能且硬件结构固定的“芯”。
用户没有办法对它做的硬件构造进行任何的更改,只能够看着制造商提供的芯片datasheet进行编程控制。
而“软核”、“硬核”的说法主要还是针对可编程逻辑器件如FPGA 上嵌入的CPU而言的。
那么有些人可能就纳闷了,既然都嵌在FPGA上,又为何有软硬之分呢?FPGA不都是硬件吗?没有错,FPGA是硬件,它所实现的逻辑功能也确确实实是各种各样门电路的集合。
但这里的软硬叫法和通常所言的软件硬件叫法是有区别的。
别急,马上就要说区别了。
如果一个FPGA像Xilinx家的什么Virtex XX系列号称内嵌了最多数个PowerPC (想知道它是什么吗?自己动手丰衣足食,搜去),那么这里的“内嵌”就意味着这个FPGA 器件的CPU是“硬核CPU”。
而Altera家主推它的“NIOS2软核CPU”,软就是只要资源足够那么就可以用逻辑堆砌起来的一个“CPU”。
再具体点说,硬核就是FPGA本身就嵌入了一个这样的CPU硬件结构,只是用与不用、如何使用的问题交给设计者决定而已;而软核则是FPGA本来并不存在这样的硬件结构,设计者使用了某种硬件描述语言(或者说是最基本的逻辑门电路)活生生的搭建了一个CPU来。
这么说好像还不过瘾,那就打个比方加深一下理解。
记不记得小时候咱们刚上学时练字的“美好时光”,我是记得还有什么专门的一节“写字课”,开始练字的时候还要用字帖(字帖上模模糊糊的有字的轮廓,照着写就行),练到一定水平就要抛开字帖,拿着白纸写就可以了。
而硬核就好比这个字帖,每个要写的字都是固定好的,你必须照着去写;而软核就好比这个白纸,上面什么都没有,要写什么字都可以。
同样写一个“爱”字,在写之前,硬核是有轮廓在那里的,软核上什么都没有。
硬核临摹一下就好,并且只能写这个字;软核靠自由发挥,你也可以写别的字。
“临摹”出来的硬核写的肯定漂亮,并且稳定性好、性能佳,但是可“临摹”的功能是固定的,这块电路是“死”的,不能写别的“字”了;而自由发挥的软核虽然可能没那么端端正正、稳定性可靠性都差一些,但是可写的“字”不受局限,灵活性也高得多。
SOPC是什么好了,时间不早,要继续下一个议题。
上面说到了MCU是“麻雀虽小、五脏俱全”,下面就不跑题直接聊SOPC的“十脏俱全”。
唉,5:30下班,6:00出门,7:00到家,8点开始写,都快10点了,这第一章才刚扯到这里。
为了加快一下教程进度,请允许特权同学引用一段特权老师在《深入浅出玩转FPGA》笔记2中的一段话来阐述SOPC的概念。
数字电路高度集成化是现代电子发展的大势所趋,片上系统(SOC)的概念也就应运而生。
它是指在单个芯片上集成一个完整的系统,一般包括系统级芯片控制逻辑模块、微处理器\微控制器内核模块、数字信号处理器模块、存储器或存储器控制模块、与外部通信的各种接口协议模块、含有ADC\DAC的模拟前端模块、电源及功耗管理模块,它是一个具备特定功能、应用于特定产品的高度集成电路。
片上系统其实就是系统小型化的代名词。
如图1.1,一个相对复杂的系统采用传统的设计方案可能需要一个CPU做整体控制,一个FPGA做接口的逻辑粘合和一些信号的预处理,还需要一个DSPs做复杂的算法实现,FLASH和SDRAM分别作为程序存储和数据缓存,这些器件都放置在一块或者数块PCB板上。
这样一个系统显得相当繁杂,不仅调试难度大,而且系统维护也不方便。
图1.1 传统的复杂系统基于FPGA的片上系统提出了这样一种解决方案,如图1.2所示,FPGA内部集成了CPU、DSP以及各种接口控制模块,对有些存储量要求不大的系统甚至外部的FLASH和SDRAM都集成了。
图1.2 基于FPGA的片上系统明白了吧,SOPC就是一颗比“MCU”更powerful的“MCU”。
它的伟大之处在于系统的完全自主定制性,有了SOPC这个东东,设计者就不需要再拿着选型手册海选既必须有这个外设又必须有那个外设的处理器了;甚至有时也不需要考虑处理器都能够挂上什么样的存储器来存数据跑程序。
只要有SOPC,一切轻松搞定,外设?想加什么就加什么,那句广告词怎么说来着,“我的地盘听我的”。
这就是SOPC相对于以往的嵌入式系统设计最大的特点和优势。
SOPC好像说得还不够尽兴,那么下面就套用一点官话来彰显一下本教程的权威性,哈哈!SOPC是一个强大的系统开发工具。
SOPC Builder可以帮助用户定义并产生一个完整的system-on-programmable-chip(SOPC,这个还是用原文吧),它比传统的手动集成方式要方便得多。
SOPC Builder工具集成在Quartus II软件中。
用户可以使用SOPC Builder生成一个基于NIOS2处理器的系统。
然而,SOPC Builder远不止一个NIOS2 builder而已,它也可以生成一个不包含处理器或者包含NIOS2以外的软核处理器的系统。
使用传统的设计方法,用户必须手动编写HDL代码用于连接各个子系统。
而使用SOPC Builder,用户只要通过傻瓜的图形界面接口(GUI)就可以自动生成各个组件的互联逻辑。
SOPC Builder产生了系统所有组件的HDL文件,顶层的HDL文件则例化好系统的所有组件。
SOPC Builder既能够生成Verilog也能够生成VHDL代码。
说了这么多,可能很多不注意听讲的同学还是不太能够区分SOPC和NIOS2,甚至有点搞混了。
不要紧,再上张图让大家饱饱眼福。
如图1.3所示,是一个简单的嵌入式系统。
在一块PCB(Printed Circuit Board)板上,单论芯片可能只是一片FPGA、一片作为协处理器(Co-Processor)的CPU、两片DDR2的SDRAM存储器分别挂在FPGA和协处理器上、还有一个叫做总线桥(Bus Bridge)的接口(它也许只是简单的连线而已,也许是一块协议芯片)。
这个系统中,看似简单,好像没啥花头。
其实不然,FPGA里有大文章可做。
想继续往下说,但是发现会有一点痛苦,因为这里要普及概念,所以不得不把该说的通通说一遍,哎,可能要费些笔墨。
图1.3 FPGA上的SOPC系统实例从总线桥开始吧,先说桥,通俗的理解桥就是用来连接河两岸的,一定听说过主板上的南桥北桥吧(CPU和内存什么的居然还隔着条河!?)。
CPU很好很强大,可以处理海量数据,但是再强大也没法发出声音显示图像啊,术业有专攻嘛,CPU就是干数据运算和传输的活,别的基本不管。
因此,CPU需要通过桥和外围设备进行信息交互,把需要进行处理的数据接收进来,把处理完的数据发送出去,可能说得不是很专业,但是基本就是这样了。
那么总线又是什么?CPU的管脚终归是有限的,如果一个CPU要和所有外设都搭个独木桥,那么恐怕咱们的CPU要比得上巴掌大才够在肚子底下容下那么多“脚”了,这么看,这个桥还真不能是独木桥。
至少该是一座纵横南北的立交桥,再形象一点说,这座立交桥的交错中心点是贯通的,处于这个中心点的车可以通过处于任何高度的道路驶向四面八方。
那么,我们所说的CPU就处于这样的核心位置。
好,这里不再深入了,总线其实就是CPU的一组满足一定协议的管脚的集合(对不起,不是很“官方”的总线解释,怎么感觉有点在做数学概念的定义,嘿嘿,特权同学的数学没白好过),这组管脚可以和多个同样满足这个特定协议的不同外设进行连接。
当CPU要用这个总线和某个外设交互信息时,就会在它们之间搭起一座“独木桥”,其它外设就只能望桥兴叹。
总线从某种意义上看就是为了节约管脚而出现的,当然从另一种意义上看也是为了统一信息交互方式而出现的。