Previous | Next --- Slide 13 of 55
Back to Lecture Thumbnails
suninhouse

Is there a particular design consideration why Scala is chosen to embed Spatial into?

pslui88

Spatial is nice because it is a higher-level language than a hardware specification language like Verilog (which programs the wires), but it still allows control over many important factors to performance, such as pipelining and data transfers.

anon33

I would hypothesize that Spatial is embedded in Scala for similar reasons why Spark is. It seems like Spatial came out of Stanford DAWN which cares a lot about scalable, portable, maintainable infrastructure for industry applications, and I think Java/Scala provides the best ecosystem for that right now.

jyeung27

Another benefit of Spatial is it tries to figure out how to arrange memory in the hardware - we can do a similar thing with SRAM as DRAM to match the number of banks to the accessing of those banks with minimal resources!

tp

To reiterate, perhaps the biggest benefit of spatial over an HDL like verilog is that it has a much more intuitive abstraction that's more similar to typical programming languages than an HDL. Unlike with an HDL, you don't have to construct everything using basic logic gates that all execute simultaneously with each clock cycle.

mkarra

To reiterate, one huge benefit to Spatial is that it is able to figure out a program's memory access patterns and arrange memory in hardware accordingly so as to enhance concurrency and speed. We saw an example of these memory access patterns with DRAM, and Spatial enables us to do the same thing with SRAM.

tspint

I was actually poking around the Spatial documentation and actually read that when writing Spatial code, you can either target Scala or a Chisel (a hardware description language that can compile down to Verilog). Using Scala would be for quickly simulating the application for testing correctness, but you would have to compile it to Chisel then Verilog to fully test it. I don't think this would affect Spatial programming (since it's just a backend), but I thought it was interesting how you could just compile and run the Scala code or "convert it" for FPGA.

tspint

Forgot to add the link above: https://spatial-lang.readthedocs.io/en/stable/tutorial/helloworld.html

Please log in to leave a comment.