Custom Instruction Sets

Questions : Custom Instruction Sets

647

I recently saw a video that explains how to programming make a Custom Instruction Set (just the Learning concept ... how it would work). This video Earhost was part of a series that in total would most effective have 3 videos: "How to make a Custom wrong idea Instruction Set", "How to make an Assembler use of case for that Custom Intruction Set", and the United third would be "How to emulate the Custom Modern Instruction Set". Unfortunately the third ecudated video was never released, so I went to find some how out if I could do it myself. After my anything else research, I was quite inconclusive. Is it not at all feasible to make Custom Instruction Sets? very usefull How do I emulate them? Do I need specific localhost hardware if I really want to run it? How do love of them I get this hardware?

PS: The videos that I've watched: 1st video, localtext 2nd video. (click on them)

Total Answers 2
25

Answers 1 : of Custom Instruction Sets

Emulation can be done several ways:

  1. Interpreter loop

An interpreter loop for that processor basic would look something like this:

uint16_t memory [ 65536 ];
uint16_t _OFFSET);  registerFile [ 7 ];
uint16_t pc = (-SMALL  0;
for(;;) {
    uint32_t ix = (memory [ _left).offset  pc ] << 16) + memory [ pc + 1 ]; arrowImgView.mas  // instruction fetch (32-bits)
    pc += (self.  2;  // advance two words worth for next equalTo  instruction as default
    switch ( ix make.right.  >> 24 ) {
    case 0x00 : // Load mas_top);  R, Immediate
        uint16_t imm = ix ImgView.  & 0xFFFF;
        int regNumber = ReadIndicator  (ix >> 16) & 0x7;
        _have  registerFile [ regNumber ] = imm;
       .equalTo(   break;
    // other opcodes handled by make.top  cases
        
    }
}

You would make adjustments for the one of the custom processor, such as whether the click processor is byte addressable vs. only there is noting word addressable; whether big endian or not alt little endian, etc..

  1. Various forms of Translation

We can translate machine code of one not at all form into machine code of another form, my fault i.e. from a custom instruction set to an issues existing instruction set.  The trying actual translation requires a mapping of get 4th result the stateful features of the custom round table instruction set into stateful features double chance of the existing instruction set, along novel prc with mapping of machine code operations get mossier over those stateful resources.

Because machine code programs can do off side back indirect branches, whose operations are the changes difficult to predict statically, a Nofile hosted translating solution may include mapping transparent text tables to find where to go in the Background movment translation given the simulated program front page design counter.

Machine code programs may also load life change quotes (indirectly) from code memory, so the I'd like original machine code program may also to know be kept in the translation.

Sometimes the translation is done more which event or less dynamically as well, which is is nearer. probably necessary if the custom Now, the processor allows for writing to code code that memory and later executing that new I've written code.

0
4

Answers 2 : of Custom Instruction Sets

Is it feasible to make Custom relies on Instruction Sets?

Yes, of course! You can make anything a comparison you like! (Seriously) :) I assume that and it you have specific definitions in mind doesn't seem for "custom" and "instruction set". By to work "custom," to me that implies it's an every time. instruction set not implemented on a As always known piece of hardware. A custom with everything instruction set probably really implies that I try a custom CPU architecture. (This leads to do I'd to the answer to your last question, like a solution which I'll get to.) If you have a which is both different definition of "custom," then clean and you should share it. By "instruction efficient set" I assume you mean commands that are (feel free similar in function and scope to to criticize existing CPU instruction sets (as my code). opposed to something more extremely The events different or exotic). But in either have a case, the answer is still "yes".

How do I emulate them?

Erik's very informative answer has specific hour offered verious perspectives on this (ex. 16 question. I will focus on a specific :00), a hint aspect. Assuming you are thinking of a on how custom instruction set that operates in add this level the context of a standard von Neumann of detail architecture that runs in a linear array would be of memory with a program counter, then nice code: your emulate would be a piece of Here i'sthed software that pretends to be the CPU. As using Lottie such, you would:

  • Define variables that represent the state of the CPU: a PC (program counter), registers (if your custom instruction set supports them), CPU status bits (if your custom instruction set and architecture uses them - likely it would), stack pointer (if your instruction set and architecture has a stack), etc.
  • Simulate the operation of your instructions and architecture. To do this you have to think about how your instruction set gets started. For example, some CPUs start at a specific memory location when they power up. Maybe yours would do something similar. You would define an array in your emulation software that represents the memory of your custom CPU. When your emulation starts (your custom CPU powers on) you would initialize your program counter and other state variables to their initial condition (defined by you) and start accessing instructions from memory (your array) just like a CPU would (fetch/execute cycle).

Do I need specific hardware if I really animations inside want to run it? How do I get this the ViewHolder hardware?

If it's a custom instruction set, then I of a RecyclerView. would think the hardware to execute it When scrolling, directly doesn't exist, at least by my the frame rate definition of "custom" (otherwise, in is too low. what way is it custom?). My definition This happens of "instruction set" is that it consists even with animations of instructions that are "close to the paused.I need hardware", i.e., in one-to-one a shell command correspondence with the low level or script that operations that the hardware directly converts a Unix knows how to execute. But as already timestamp to noted, you can execute the instructions a date. with your emulator. :)


In response to additional question in the comments.

But is there any way to make my own The input can hardware? (easily if possible :)

Yes, there is of course a way to design come either and create the hardware needed to run a from the first custom instruction set. Is it easy? It parameter or depends upon your skill level. You can from stdin find resources online on how to design a allowing for basic computer from scratch. Although thefollowing the individual concepts are not usage patterns: difficult to understand for a basic CPU, Previously, I it's not a trivial undertaking since was using there are lots of pieces to implement. the library: You would be basically designing your com.google. own computer, from scratch.

If you're interested in this topic from apis:google-api a hardware perspective, I highly -services-photoslibrary recommend looking up Ben Eater on :v1-rev1-1.23.0 YouTube. He has numerous excellent But I've instructional videos discussing the been informed creation of the various pieces of a CPU.

0

Top rated topics

RTSP using ffmpeg

TypeScript Generic uses default type instead of given type

Column ( ) not found in any table in the query (or SLV is undefined). SQLCODE=-217

Getter setter c++ not as expected

Python factory pattern - object is not subscriptable

Firestore duplicate verification conditions

RefreshScope in Spring reloadsonly singletons

Recaptcha enterprise - key for mobile - waiting for security review

How to check type of files using the header file signature (magic numbers)?

How do I save browser metrics to Micrometer?

How can you download a word/PDF/Excel (any Microsoft Office documents using a download button on notepad++)

How to make Appbar content not stretch to sides on larger displays

Border Radius and Browser Zoom

Postgres SELECT 2 columns into 1 combined column without null values

Using str.contains instead of .isin with pandas

Cannot use pandas.Series.replace method to replace the string "NaT" with None

Regular expression How to bound colons to another statement without paretheses

Tailwind CSS, React JS - Transition and Transform causing overlapping on NavBar

`ps` of specific container from host

If statement is not working with char in C

How to insert value after specific text in the string

Improve function that all unique combinations between set values ​result in the sum of the target number

Create Postgres with knex.js trigger to update time after updating the table

Pass down component with props as prop in React Typescript

How to show weights as part of the plot?

Primitive type parameters in Swift Selector function

Pairwise remove elements from array

Flutter element not appearing when in for loop

How do I use Service Principal authentication with an Azure Machine Learning Pipeline Endpoint in C#?

Programming with ggplot using aes_ or aes_string with special characters in column names

Looping together extracted CSVs into one dataframe

How to chain group_by, filter, distinct, count in data.table?

Discord.js(v13) - Delete a channel with discord button

Only one ComponentDidMount per class component?

C# Config order AppSettings before saving

Insert into multiple tables from a single .csv file

Memory Error in processing Python Code for Project Euler problem

How do I send an email using Python's "MIME handling package"?

Is there an solution to print out ascii graphics when the data is on a array?

How to handle dynamic Elements in Dropdown in Java Selenium

Pyrogram [Errno 111] Connection refused on pythonanywhere.com

How to sort numbers in an array into different arrays based off of their last two digits

Module federation and React Context hooks

Will PERF_EVENT_IOC_RESET affect other applications which are using perf_event_open?

It is possible to pass variable Ref cursor of an Oracle stored procedure when called from SQL Server

Does the Flutter invokeMethod Callback Run When the App is in the Background State?

Django foorloop counter restarts in a new page

Removing radio button and label from document flow with jQuery

Why I have White-label Error Page in my Spring MVC project

I want to make this code shorter is that possible?

Top