200918November

Extensible Processors

In my previous post, I mentioned an article where the author suggested using customized processors to implement a system on a chip. Another interesting topic is somewhat related, but from the opposite direction - the subject of extensible processors. It involves the improvement of general processors by adding custom logic.

Microsoft Research has an architecture they’ve developed called eMIPS, which takes a MIPS processor and adds an FPGA that has access to each datapath stage. This allows for a dynamically reconfigurable bit of logic to implement custom instruction extensions. There are even tools that enable you to pick a block of machine code out of a program and automatically generate the custom logic to implement it - this is done with software tool called MIPS-to-Verilog. Using another program (BBTools), the new instructions that invoke the custom logic are automatically inserted into the program and the original code stays there as a software fallback. This software fall back can be useful if, for instance, the operating system didn’t allow the program to add the custom logic because a higher priority program was already using the FPGA extension.

I would also point out that this setup resolves the CISC/RISC dilemma. Some processing tasks which can be done on a simpler RISC architecture can be done much faster if these tasks are implemented directly in hardware (leading to a CISC architecture), however, there are very many such tasks: choosing the ones that make it into an architecture is difficult. Additionally, every task that is implemented complicates the processor and makes it more difficult to debug and generally optimize. Since an extensible processor can have the custom logic reprogrammed on the fly, the programmer (or perhaps a sophisticated compiler) gets to insert whatever additional logic is needed.

200918November

An Overview of SoC Design

I routinely read EDN and EETimes. There are an abundance of articles on these sites about SoC (System on a Chip) design that talk about things like ESL and EDA. These articles have been over my head since I have not yet done SoC design. I took a class on MEMS that included some interesting content about SoCs, but it covered more about what they are, their applications, and some fabrication challenges. Finally, I have found an article that has a good overview of how the design process works.

The author talks about ESL design and algorithm synthesis, which is a software approach to SoC design that takes a high-level algorithmic description (typically written in C) and converts it to RTL logic. He points out that this is not the only approach to system level design: instead, you can use customizable processors (which can directly run the C code) to implement algorithms in an SoC. This is very interesting and something I would definitely enjoy doing because I love programming, microprocessor architectures, and logic design.

20091November

Object Literal Notation: What's Up With That?

This article is intended for people familiar with computer programming.

Some languages support a feature called object literal notation. JavaScript is one such language.

Statements such as: x = 5; or name = "Shawn"; are common in programming. The part on the right (5 or "Shawn") is called a literal. (Technically, the literal is Shawn and the quotes are metadata which tell the interpreter or compiler what its type is.) The first is an integer literal; the second is a string literal. In some respects, it is like a constant. 5 is always 5: you can’t change its value. Unlike a constant, a literal’s value is immediately obvious upon reading it - its name is its value. Such is true in an object literal.

Here is an example of an object definition in JavaScript:

var person = new Object(); person.name = "Shawn"; person.addFriend = function(friend) { //add a person as a friend }
This example does not use object literal notation. It creates a basic object, then modifies it by adding properties and methods. Sometimes it’s useful just to define the object instead of to create one and modify it several times. This is done with object literal notation.

var person = { name: "Shawn", addFriend: function(friend) { //add a person as a friend } }
Note that everything after the equals is a literal. Since the literal is of type object, it is an object literal.

Tagged: and 
200918August

Firefox: Mozilla Weave and NoScript Plugins

Mozilla Labs has a very neat extension for Firefox called Weave which allows you to synchronize your browsing experience (history, tabs, saved passwords, etc). It’s quite nifty, but if you have the NoScript plugin installed, it interferes with the setup process. To fix that, simply tell NoScript to allow (or temporarily allow) mozilla.com.

Tagged:
200928July

CSS3 Flexible Box Layout Module

This article is intended for experienced web designers.

the need for another layout model

I am excited by the new Flexible Box Layout Module draft from W3C. There are many types of web layout designs that require content of a set width along side content that should simply fill some variable amount of leftover space. Such an example is a left navigation column with a right content column. There currently is no good mechanism for doing this; designers hack around this by using things like negative margins and huge padding figures.

This draft attempts to meet that need by allowing the designer to specify that a block or group of blocks should take up whatever space is left over. The draft ads a new display property to the existing inline, block, inline-block, table-cell et al. It is called box. Children of the box element may be oriented horizontally or vertically and may themselves be boxes with either horizontal or vertical orientations.

box-flex

The neat part is the box-flex property assigned to each child. By default, the children are assigned a box-flex of 0, which is inflexible. It can be set to any nonnegative floating point number. This number is used to describe how much it flexes, relative to other flexible elements in the box. For instance, if I have a box with three children with box-flexes of 0, 1, and 2:
<div style="display: box; width: 500px;"> <div style="box-flex: 0; height: 300px; width: 100px;"></div> <div style="box-flex: 1; height: 300px; width: 100px;"></div> <div style="box-flex: 2; height: 300px; width: 100px;"></div> </div>
The containing box is wider than the children elements, so the size of the children that are flexible (those with a box-flex greater than 0) will be adjusted to fill the containing box. In this case, the child with the box-flex of 2 will gain twice as much width as the child with box-flex of 1. If both had box-flex of 1, they would each gain the same amount of width. Additionally, if the containing element was smaller than the combined width of the children, the flexible elements would shrink. The properties min-width and max-width may be used to limit a child element from shrinking or growing past a fixed width.

a welcome change

A primary reason people are still tempted to use table based layouts is because there is an easy way to make a cell take up the rest of the unused space. The box-flex property meets and exceeds that requirement. This is a much needed addition to the CSS specification.

Tagged: and