紧急~~模拟器问题 [英] Urgent ~~Simulator Question

查看:78
本文介绍了紧急~~模拟器问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

任何人都可以帮我解决这个问题。因为这是我第一次学习C ++

语言而且我的讲座要我做这种程序,我真的没有

有什么理想的

请帮助我


这里是问题::

改进以下(写得不好)矩阵乘法程序和

将其翻译成MIP汇编语言,然后汇编成机器语言

(十六进制表示)。您可以使用编译器生成一个程序集

语言文件和SPIM来生成最终的十六进制机器语言但是

根据过去的经验,手动编译程序会更快

学生。这也意味着你需要在

模拟器中实现更少的指令,或者用另一种方式,少做工作。


#define n的变化见下面的typedef char index_; typedef longint

matrix [n + 1] [n + 1]; main(){index_ i,j,k;矩阵a,b,c; for(j = 0;

j< n; j ++){for(i = 0; i< n; i ++){a [i] [j] = i * j; b [i] [j]

= a [i] [j]; for(i = 0; i< n; i ++){for(k = 0; k< n; k ++)

{c [k] [i] = 0.0; for(j = 0; j< n; j ++)c [k] [i] + = a [k] [j]

* b [j] [i];
从你的

教科书中为最终版本的流水线数据路径编写一个模拟器,添加一个1位分支预测器并假设有两个流水线延迟

为数据存储器。分支逻辑必须保留在ALU阶段;不要

将其移回寄存器/解码阶段。你必须使用分支刷新(不要使用分支延迟插槽),你必须实现数据转发并检测

并解决负载危险。


注意文本有很多错误。


模拟器必须在屏幕上显示管道和寄存器的内容

正在使用和8个内存从一个当前正在访问的地点开始的地点

。只要屏幕

不会在每个时钟周期滚动,就可以使用简单的基于文本的显示!模拟器还必须支持单步

步进操作,并且能够运行直到达到特定指令地址

。模拟器必须以十六进制格式机器读取

指令。您可以选择使用哪种语言。


您只需要执行

乘法程序中使用的指令。对于赋值1,仅使用16x16矩阵。分支

目标缓冲区必须只有一个条目(为了简化问题!)。


~让我们linux~

----- =通过Newsfeeds.Com发布,未经审查的Usenet新闻= -----
http://www.newsfeeds.com - 世界排名第一的新闻组服务!

----- ==超过100,000个新闻组--19个不同的服务器! = -----

Hi all,
Can anyone help me to do this Question. Coz this is my first time study C++
language and my lecture want me to do this kind of program, i really don''t
have any ideal
pls help me

here is the Question::
Improve the following (badly written) matrix multiplicationprogram and
translate it into MIPs assembly language then assemble into machine language
(hexadecimal representation). You may use a compiler to produce an assembly
language file and SPIM to produce the final hexadecimal machine language but
it WILL be faster to compile the program manually given past experience by
students. It will also mean you need to implement less instructions in the
simulator, or put it another way, do LESS WORK.

#define n varies see belowtypedef char index_;typedef longint
matrix[n + 1][n + 1];main(){ index_ i, j, k; matrix a, b, c; for (j = 0;
j< n; j++) { for (i = 0; i< n; i++) { a[i][j] = i * j; b[i][j]
= a[i][j]; } } for (i = 0; i< n; i++) { for (k = 0; k< n; k++)
{ c[k][i] = 0.0; for (j = 0; j < n; j++) c[k][i] += a[k][j]
* b[j][i]; } }}
Write a simulator for the final version of the pipelined datapath from your
text book adding a 1-bit branch predictor and assuming two pipeline delays
for the data memory. The branch logic MUST remain in the ALU stage; do not
move it back to the register/decode stage. You MUST use branch flushing (do
NOT use branch delay slots), you MUST implement data forwarding and detect
and resolve load hazards.

Beware the text has a number of errors.

The simulator must display on screen the contents of pipeline and registers
being used and 8 memory locations commencing with one currently being
accessed. A simple text based display is acceptable as long as the screen
does not scroll every clock cycle! The simulator must also support single
step operation and be able to run until a particular instruction address is
reached. The simulator must read in the hexadecimal format machine
instructions. You may choose what language to use.

You are only required to implement the instructions used in the
multiplication program. For Assignment 1 use 16x16 matrices only. The Branch
Target Buffer must have only 1 entry only (to simplify the problem!).

~ Let us linux ~
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----

推荐答案

" Milk" < MI ********* @ yahoo.com>写了...
"Milk" <mi*********@yahoo.com> wrote...
大家好,
任何人都可以帮我做这个问题。 [...]
Hi all,
Can anyone help me to do this Question. [...]




这在常见问题解答中解答( http://www.parashift.com/c++-faq-lite/

输入家庭作业进入搜索领域。



This is answered in the FAQ (http://www.parashift.com/c++-faq-lite/)
Enter "homework" into the search field.


" Milk" < MI ********* @ yahoo.com>写了...
"Milk" <mi*********@yahoo.com> wrote...
大家好,
任何人都可以帮我做这个问题。 [...]
Hi all,
Can anyone help me to do this Question. [...]




这在常见问题解答中解答( http://www.parashift.com/c++-faq-lite/

输入家庭作业进入搜索领域。



This is answered in the FAQ (http://www.parashift.com/c++-faq-lite/)
Enter "homework" into the search field.


2004年4月11日00:50:16 +0800 in comp.lang.c ++,Milk

< MI ********* @ yahoo.com>写道,
On 11 Apr 2004 00:50:16 +0800 in comp.lang.c++, "Milk"
<mi*********@yahoo.com> wrote,
任何人都可以帮我做这个问题。因为这是我第一次学习C ++
语言而且我的讲座要我做这种程序,我真的没有理想的


不知道问题通常超出了新闻组所期望的b $ b预期的帮助。我想你应该和你的导师谈谈

关于为什么他的课不适合你。

这里是问题::
改善以下(严重写入)矩阵乘法程序并将其转换为MIP汇编语言然后汇编成机器语言


当然汇编语言部分不在此处。你有没有关于C ++部分的问题?

从你的
教科书中添加一个1比特的流水线数据路径的最终版本写一个模拟器分支预测器和假设两个管道延迟
Can anyone help me to do this Question. Coz this is my first time study C++
language and my lecture want me to do this kind of program, i really don''t
have any ideal
"Don''t have any idea" questions are often beyond the help that you can
expect from newsgroups. I think you should go talk to your instructor
about why his class is not working for you.
here is the Question::
Improve the following (badly written) matrix multiplicationprogram and
translate it into MIPs assembly language then assemble into machine language
Of course the assembly language part of that is not on topic here. Did
you have a question about the C++ part?
Write a simulator for the final version of the pipelined datapath from your
text book adding a 1-bit branch predictor and assuming two pipeline delays




这是一个非常大的项目;你不应该期望完成它

而不花一些时间。你的紧急主题建议你不这么认为





That''s a pretty large project; you should not expect to accomplish it
without spending some time on it. Your "Urgent" subject suggests that
you thought otherwise.


这篇关于紧急~~模拟器问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆