Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added manafacture tests

  • Loading branch information...
commit ba0f89800eb3d98f02bd7025565b49c662147d5c 1 parent eb3b296
@andrewstanfordjason andrewstanfordjason authored
View
5 CHANGELOG.rst
@@ -1,6 +1,11 @@
sc_sdram_burst Change Log
=========================
+1.0.5
+-----
+ * Fixed regression test bug where code was not properly generalised
+ * Added manafacture test app
+
1.0.4
-----
* Extended control defines to work for 4 bit ports in an arbitrary way
View
48 app_sdram_mfg_tests/.cproject
@@ -101,7 +101,7 @@
<folderInfo id="com.xmos.cdt.toolchain.1293654845.1976110569" name="/" resourcePath="">
<toolChain id="com.xmos.cdt.toolchain.1959327951" name="com.xmos.cdt.toolchain" superClass="com.xmos.cdt.toolchain">
<targetPlatform archList="all" binaryParser="com.xmos.cdt.core.XEBinaryParser" id="com.xmos.cdt.core.platform.1009297187" isAbstract="false" osList="linux,win32,macosx" superClass="com.xmos.cdt.core.platform"/>
- <builder arguments="CONFIG=Debug" id="com.xmos.cdt.builder.base.1340856853" keepEnvironmentInBuildfile="false" managedBuildOn="false" superClass="com.xmos.cdt.builder.base">
+ <builder appendEnvironment="true" arguments="CONFIG=Debug" environment="XTA_ENABLED=true|" id="com.xmos.cdt.builder.base.1340856853" keepEnvironmentInBuildfile="false" managedBuildOn="false" superClass="com.xmos.cdt.builder.base">
<outputEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="outputPath" name="bin/Debug"/>
</outputEntries>
@@ -157,6 +157,13 @@
<option id="com.xmos.xc.compiler.option.include.paths.1345018201" name="com.xmos.xc.compiler.option.include.paths" superClass="com.xmos.xc.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${XMOS_TOOL_PATH}/target/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${XMOS_TOOL_PATH}/target/include/gcc&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V2_IS42S16400F}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V0}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V1_IS42S16400F}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V1_IS42S16160D}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src}&quot;"/>
</option>
<inputType id="com.xmos.cdt.xc.compiler.input.132436920" name="XC" superClass="com.xmos.cdt.xc.compiler.input"/>
</tool>
@@ -267,6 +274,13 @@
<option id="com.xmos.c.compiler.option.include.paths.668055408" name="com.xmos.c.compiler.option.include.paths" superClass="com.xmos.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${XMOS_TOOL_PATH}/target/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${XMOS_TOOL_PATH}/target/include/gcc&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V2_IS42S16400F}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V0}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V1_IS42S16400F}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V1_IS42S16160D}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src}&quot;"/>
</option>
<inputType id="com.xmos.cdt.c.compiler.input.c.313716487" name="C" superClass="com.xmos.cdt.c.compiler.input.c"/>
</tool>
@@ -383,6 +397,13 @@
<listOptionValue builtIn="false" value="&quot;${XMOS_TOOL_PATH}/target/include/gcc&quot;"/>
<listOptionValue builtIn="false" value="&quot;${XMOS_TOOL_PATH}/target/include/c++/4.2.1&quot;"/>
<listOptionValue builtIn="false" value="&quot;${XMOS_TOOL_PATH}/target/include/c++/4.2.1/xcore-xmos-elf&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V2_IS42S16400F}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V0}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V1_IS42S16400F}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V1_IS42S16160D}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src}&quot;"/>
</option>
<inputType id="com.xmos.cdt.cxx.compiler.input.cpp.1245334835" name="C++" superClass="com.xmos.cdt.cxx.compiler.input.cpp"/>
</tool>
@@ -413,6 +434,8 @@
</target>
</buildTargets>
</storageModule>
+ <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+ <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
</cconfiguration>
<cconfiguration id="com.xmos.cdt.toolchain.1873519196">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.xmos.cdt.toolchain.1873519196" moduleId="org.eclipse.cdt.core.settings" name="Release">
@@ -567,6 +590,13 @@
<option id="com.xmos.xc.compiler.option.include.paths.1096009201" name="com.xmos.xc.compiler.option.include.paths" superClass="com.xmos.xc.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${XMOS_TOOL_PATH}/target/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${XMOS_TOOL_PATH}/target/include/gcc&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V2_IS42S16400F}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V0}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V1_IS42S16400F}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V1_IS42S16160D}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src}&quot;"/>
</option>
<inputType id="com.xmos.cdt.xc.compiler.input.1746118058" name="XC" superClass="com.xmos.cdt.xc.compiler.input"/>
</tool>
@@ -677,6 +707,13 @@
<option id="com.xmos.c.compiler.option.include.paths.660314291" name="com.xmos.c.compiler.option.include.paths" superClass="com.xmos.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${XMOS_TOOL_PATH}/target/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${XMOS_TOOL_PATH}/target/include/gcc&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V2_IS42S16400F}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V0}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V1_IS42S16400F}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V1_IS42S16160D}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src}&quot;"/>
</option>
<inputType id="com.xmos.cdt.c.compiler.input.c.454466900" name="C" superClass="com.xmos.cdt.c.compiler.input.c"/>
</tool>
@@ -793,6 +830,13 @@
<listOptionValue builtIn="false" value="&quot;${XMOS_TOOL_PATH}/target/include/gcc&quot;"/>
<listOptionValue builtIn="false" value="&quot;${XMOS_TOOL_PATH}/target/include/c++/4.2.1&quot;"/>
<listOptionValue builtIn="false" value="&quot;${XMOS_TOOL_PATH}/target/include/c++/4.2.1/xcore-xmos-elf&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V2_IS42S16400F}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V0}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V1_IS42S16400F}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src/PINOUT_V1_IS42S16160D}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/module_sdram/src}&quot;"/>
</option>
<inputType id="com.xmos.cdt.cxx.compiler.input.cpp.1928463603" name="C++" superClass="com.xmos.cdt.cxx.compiler.input.cpp"/>
</tool>
@@ -824,6 +868,8 @@
</target>
</buildTargets>
</storageModule>
+ <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+ <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
View
4 app_sdram_mfg_tests/.project
@@ -50,6 +50,10 @@
<value>true</value>
</dictionary>
<dictionary>
+ <key>org.eclipse.cdt.make.core.environment</key>
+ <value>XTA_ENABLED=true|</value>
+ </dictionary>
+ <dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
View
6 app_sdram_mfg_tests/Makefile
@@ -9,15 +9,15 @@ TARGET = SLICEKIT-L2
APP_NAME = app_sdram_mfg_tests
# The USED_MODULES variable lists other module used by the application.
-USED_MODULES =
+USED_MODULES = module_sdram
# The flags passed to xcc when building the application
# You can also set the following to override flags for a particular language:
# XCC_XC_FLAGS, XCC_C_FLAGS, XCC_ASM_FLAGS, XCC_CPP_FLAGS
# If the variable XCC_MAP_FLAGS is set it overrides the flags passed to
# xcc for the final link (mapping) stage.
-XCC_FLAGS_Debug = -O0 -g
-XCC_FLAGS_Release = -O2 -g
+XCC_FLAGS_Debug = -g -O3 -Wcodes -Xmapper -Wcodes
+XCC_FLAGS_Release = -g -O3 -Wcodes -Xmapper -Wcodes
# The VERBOSE variable, if set to 1, enables verbose output from the make system.
VERBOSE = 0
View
295 app_sdram_mfg_tests/src/app_sdram_mfg_tests.xc
@@ -1,80 +1,54 @@
#include <platform.h>
-#include <stdio.h>
+#include <print.h>
#include <stdlib.h>
#include "sdram.h"
-
-#define MIN_BLOCK_WIDTH_WORDS 1
-on tile[0]: sdram_ports ports = {XS1_PORT_16A, XS1_PORT_4F, XS1_PORT_1H, XS1_CLKBLK_2 };
-
-static inline void client_write(chanend server, unsigned bank,
- unsigned start_row, unsigned start_col, unsigned words, unsigned buffer[]) {
- sdram_buffer_write(server, bank, start_row, start_col, words, buffer);
-}
-
-static inline void client_read(chanend server, unsigned bank,
- unsigned start_row, unsigned start_col, unsigned words, unsigned buffer[]) {
- sdram_buffer_read(server, bank, start_row, start_col, words, buffer);
-}
-
-static inline void client_wait_until_idle(chanend server, unsigned buffer[]) {
- sdram_wait_until_idle(server, buffer);
-}
-
-static inline void write_only(chanend server, unsigned bank, unsigned row, unsigned col, unsigned pattern){
- unsigned buf[1];
- buf[0] = pattern;
- client_write(server, bank, row, col, 1, buf);
- client_wait_until_idle(server, buf);
-}
-
-static inline void write_only_not(chanend server, unsigned e_bank, unsigned e_row, unsigned e_col){
+/*
+ * This is the SDRAM manafacture test suite. It requires:
+ * WORST_CASE_ACTIVE_CORES - this is the max number of active cores that the sdram
+ * server must be able to operate during(includes the core
+ * for the server)
+ *
+ * Prerequsites
+ * The setup should have been tested with app_sdram_regress and app_sdram_benchmark.
+ * This test is to confirm pin connections and do basic SDRAM checks not a full
+ * correctness/performance test suite.
+ *
+ * To test:
+ * - Set the sdram_ports to reflect the pinout under test,
+ * - Set WORST_CASE_ACTIVE_CORES as described above,
+ * - Run the app.
+ * - After approximatly 40 seconds the result should appear.
+ */
+
+#define WORST_CASE_ACTIVE_CORES 8
+
+/*
+ * Port configuration - This must match the physical pinout of the SDRAM - XCore.
+ */
+on tile[0]: sdram_ports ports = {
+ XS1_PORT_16A, XS1_PORT_1B, XS1_PORT_1G, XS1_PORT_1C, XS1_PORT_1F, XS1_CLKBLK_1 };
+
+/*
+ * Below here is the test code - there is no need to edit anything below here.
+ */
+
+static void fillMemory(chanend server, unsigned fill_pattern) {
unsigned buf[SDRAM_ROW_WORDS];
- for (int word = 0; word < SDRAM_ROW_WORDS; word++)
- buf[word] = 0;
+ for (unsigned word = 0; word < SDRAM_ROW_WORDS; word++)
+ buf[word] = fill_pattern;
for (unsigned bank = 0; bank < SDRAM_BANK_COUNT; bank++) {
- for (unsigned row = 0; row < SDRAM_ROW_COUNT; row++) {
- if (row == e_row && bank == e_bank){
- client_write(server, bank, row, (col+1)%SDRAM_ROW_WORDS, SDRAM_ROW_WORDS-1, buf);
- client_wait_until_idle(server, buf);
- } else {
- client_write(server, bank, row, 0, SDRAM_ROW_WORDS, buf);
- client_wait_until_idle(server, buf);
- }
- }
- }
-}
-
-static void test_row_col_bank(chanend server) {
-#define PATTERNS 8
- unsigned test_patterns[PATTERNS] = { 0, 1, 2, 3, 4, 5, 6, 7};
- printf("Started test_row_col_bank\n");
- for (unsigned i=0;i<PATTERNS;i++){
- for(unsigned bank =0; bank < SDRAM_ROW_WORDS; bank++){
- for(unsigned row =0; row < SDRAM_ROW_WORDS; row++){
- for(unsigned col =0; col < SDRAM_ROW_WORDS; col++){
- unsigned read_buf[1];
- read_buf[0]= 0x0;
- write_only(server, bank, row, col, test_patterns[i]);
- write_only_not(server, bank, row, col);
- client_read(server, bank, row, col, 1, read_buf);
- client_wait_until_idle(server, read_buf);
- if(read_buf[0] != pattern){
- printf("Failed\n");
- }
- }
- }
- }
+ for (unsigned row = 0; row < SDRAM_ROW_COUNT; row++) {
+ sdram_full_row_write(server, bank, row, buf);
+ sdram_wait_until_idle(server, buf);
+ }
}
- printf("\tPassed\n");
}
static void refresh_test(chanend server) {
-
unsigned pattern;
unsigned wait_multiplier[3] = { 1, 4, 8};
unsigned patterns[3] = { 0, 0x55555555, 0xffffffff };
unsigned buf[SDRAM_ROW_WORDS];
- printf("Started refresh_test\n");
for (unsigned p = 0; p < 3; p++) {
pattern = patterns[p];
for (unsigned w = 0; w < 3; w++) {
@@ -85,29 +59,66 @@ static void refresh_test(chanend server) {
t :> time;
t when timerafter(time+100000000):> int;
}
-
for (unsigned bank = 0; bank < SDRAM_BANK_COUNT; bank++) {
for (unsigned row = 0; row < SDRAM_ROW_COUNT; row++) {
- client_read(server, bank, row, 0, SDRAM_ROW_WORDS, buf);
- client_wait_until_idle(server, buf);
+ sdram_buffer_read(server, bank, row, 0, SDRAM_ROW_WORDS, buf);
+ sdram_wait_until_idle(server, buf);
for(unsigned word=0;word<SDRAM_ROW_WORDS; word++) {
unsigned r = buf[word];
if(r != pattern) {
- printf("Failed row read/write on row %d of bank %d on word %d\n",
- row, bank, word);
+ printstrln("Failed refresh test.");
+ _Exit(1);
}
}
}
}
}
}
- printf("\tPassed\n");
}
-void load_thread(chanend in_t, chanend out_t) {
- set_thread_fast_mode_on();
- in_t :> int;
- out_t <: 1;
+unsigned makeWord(unsigned bank, unsigned row, unsigned word) {
+ return bank + (row << SDRAM_BANK_ADDRESS_BITS) +
+ (word << (SDRAM_BANK_ADDRESS_BITS+SDRAM_ROW_ADDRESS_BITS));
+}
+
+{unsigned, unsigned, unsigned} unmakeWord(unsigned word) {
+ return {(word) & ((1<<SDRAM_BANK_ADDRESS_BITS)-1),
+ (word>>SDRAM_BANK_ADDRESS_BITS) & ((1<<SDRAM_ROW_ADDRESS_BITS)-1),
+ (word>>(SDRAM_BANK_ADDRESS_BITS+SDRAM_ROW_ADDRESS_BITS))
+ & ((1<<SDRAM_COL_ADDRESS_BITS)-1)};
+}
+
+void address_test(chanend server) {
+ unsigned max=SDRAM_BANK_COUNT;
+ for (unsigned bank = 0; bank < SDRAM_BANK_COUNT; bank++) {
+ for (unsigned row = 0; row < SDRAM_ROW_COUNT; row++) {
+ unsigned buffer[SDRAM_ROW_WORDS];
+ for (unsigned word = 0; word < SDRAM_ROW_WORDS; word++) {
+ buffer[word] = makeWord(bank, row, word);
+ }
+ sdram_buffer_write(server, bank, row, 0, SDRAM_ROW_WORDS, buffer);
+ sdram_wait_until_idle(server, buffer);
+ }
+ }
+ if(SDRAM_ROW_COUNT > max)
+ max = SDRAM_ROW_COUNT;
+ if(SDRAM_COL_COUNT > max)
+ max = SDRAM_COL_COUNT;
+
+ for (unsigned v = 0; v < max; v++) {
+ unsigned buffer[1];
+ unsigned bank = v % SDRAM_BANK_COUNT;
+ unsigned row = v % SDRAM_ROW_COUNT;
+ unsigned word = v % (SDRAM_ROW_WORDS);
+
+ sdram_buffer_read(server, bank, row, word*2, 1, buffer);
+ sdram_wait_until_idle(server, buffer);
+
+ if(makeWord(bank, row, word) != buffer[0]){
+ printstrln("Failed address test.");
+ _Exit(1);
+ }
+ }
}
void sanity_check(chanend sdram_c) {
@@ -117,139 +128,45 @@ void sanity_check(chanend sdram_c) {
#define SANITY_TEST_COL 0
unsigned input_buffer[SANITY_TEST_SIZE];
unsigned output_buffer[SANITY_TEST_SIZE];
- printf("Begin sanity_check\n");
for (unsigned i = 0; i < SANITY_TEST_SIZE; i++) {
input_buffer[i] = i;
output_buffer[i] = 0xaabbccdd;
}
- client_write(sdram_c, SANITY_TEST_BANK, SANITY_TEST_ROW, SANITY_TEST_COL,
+ sdram_buffer_write(sdram_c, SANITY_TEST_BANK, SANITY_TEST_ROW, SANITY_TEST_COL,
SANITY_TEST_SIZE, input_buffer);
- client_wait_until_idle(sdram_c, input_buffer);
- client_read(sdram_c, SANITY_TEST_BANK, SANITY_TEST_ROW, SANITY_TEST_COL,
+ sdram_wait_until_idle(sdram_c, input_buffer);
+ sdram_buffer_read(sdram_c, SANITY_TEST_BANK, SANITY_TEST_ROW, SANITY_TEST_COL,
SANITY_TEST_SIZE, output_buffer);
- client_wait_until_idle(sdram_c, output_buffer);
+ sdram_wait_until_idle(sdram_c, output_buffer);
for (unsigned i = 0; i < SANITY_TEST_SIZE; i++) {
if (i != output_buffer[i]) {
- printf("Failed sanity_check on word %d, got word: 0x%08x\n", i,
- output_buffer[i]);
+ printstrln("Failed sanity check.");
_Exit(1);
}
}
- printf("\tPassed\n");
}
-void regression_single_thread(chanend server) {
- reset_super_pattern();
- sanity_check(server);
- single_row_write(server);
- partial_row_write_read(server);
- partial_row_write_align(server);
- whole_mem_write_read(server);
- refresh_test(server);
- refresh_test_2(server);
- ordered_read(server, 4096 * 1024);
- pseudo_random_read(server, 4096 * 64);
-}
-
-void regression(chanend server, chanend in_t, chanend out_t) {
- regression_single_thread(server);
- out_t <: 1;
- in_t :> int;
-}
-
-void test_2_threads(chanend server) {
- //sdram_server
- printf("2 threaded test suite start\n");
- regression_single_thread(server);
- printf("2 threaded test suite completed\n");
-}
-
-void test_3_threads(chanend server) {
- chan c[2];
- printf("3 threaded test suite start\n");
- par {
- regression(server, c[0], c[1]);
- load_thread(c[1], c[0]);
- }
- printf("3 threaded test suite completed\n");
-}
-
-void test_4_threads(chanend server) {
- chan c[3];
- printf("4 threaded test suite start\n");
- par {
- regression(server, c[0], c[1]);
- load_thread(c[1], c[2]);
- load_thread(c[2], c[0]);
- }
- printf("4 threaded test suite completed\n");
-}
-
-void test_8_threads(chanend server) {
- chan c[7];
- printf("8 threaded test suite start\n");
- par {
- regression(server, c[0], c[1]);
- load_thread(c[1], c[2]);
- load_thread(c[2], c[3]);
- load_thread(c[3], c[4]);
- load_thread(c[4], c[5]);
- load_thread(c[5], c[6]);
- load_thread(c[6], c[0]);
- }
- printf("8 threaded test suite completed\n");
-}
-void test_7_threads(chanend server) {
- chan c[6];
- printf("7 threaded test suite start\n");
- par {
- regression(server, c[0], c[1]);
- load_thread(c[1], c[2]);
- load_thread(c[2], c[3]);
- load_thread(c[3], c[4]);
- load_thread(c[4], c[5]);
- load_thread(c[5], c[0]);
- }
- printf("7 threaded test suite completed\n");
-}
-void test_6_threads(chanend server) {
- chan c[5];
- printf("6 threaded test suite start\n");
- par {
- regression(server, c[0], c[1]);
- load_thread(c[1], c[2]);
- load_thread(c[2], c[3]);
- load_thread(c[3], c[4]);
- load_thread(c[4], c[0]);
- }
- printf("6 threaded test suite completed\n");
-}
-void test_5_threads(chanend server) {
- chan c[4];
- printf("5 threaded test suite start\n");
- par {
- regression(server, c[0], c[1]);
- load_thread(c[1], c[2]);
- load_thread(c[2], c[3]);
- load_thread(c[3], c[0]);
- }
- printf("5 threaded test suite completed\n");
+static void wait(){
+ timer t;
+ unsigned w;
+ t:> w;
+ t when timerafter (w+1000000) :> w;
}
void sdram_client(chanend server) {
set_thread_fast_mode_on();
- while(1){
- printf("Test suite begin\n");
- test_8_threads(server);
- test_7_threads(server);
- test_6_threads(server);
- test_5_threads(server);
- test_4_threads(server);
- test_3_threads(server);
- test_2_threads(server);
- printf("Test suite completed\n");
+ par {
+ {
+ wait();
+ sanity_check(server);
+ address_test(server);
+ refresh_test(server);
+ printstrln("Success");
+ _Exit(0);
+ }
+ par(int i=0;i<WORST_CASE_ACTIVE_CORES-2;i++) while(1);
}
}
@@ -259,6 +176,4 @@ int main() {
on tile[0]:sdram_server(sdram_c, ports);
on tile[0]:sdram_client(sdram_c);
}
- return 0;
}
-
View
2  app_sdram_mfg_tests/src/sdram_conf.h
@@ -1,4 +1,4 @@
#ifndef SDRAM_CONF_H_
#define SDRAM_CONF_H_
-#define SDRAM_DEFAULT_IMPLEMENTATION PINOUT_V2_IS42S16400F
+#define SDRAM_DEFAULT_IMPLEMENTATION PINOUT_V1_IS42S16400F
#endif /* SDRAM_CONF_H_ */
View
12 app_sdram_regress/src/app_sdram_regress.xc
@@ -275,7 +275,7 @@ static void refresh_test(chanend server) {
}
printf("\tPassed\n");
}
-
+/*
unsigned makeWord(unsigned bank, unsigned row, unsigned word) {
return bank + (row << 1) + (word << 13);
}
@@ -283,6 +283,16 @@ unsigned makeWord(unsigned bank, unsigned row, unsigned word) {
{unsigned, unsigned, unsigned} unmakeWord(unsigned word) {
return {word & 1, (word >> 1) & 0xfff, (word >> 13) & 0xff};
}
+*/
+unsigned makeWord(unsigned bank, unsigned row, unsigned word) {
+ return bank + (row << SDRAM_BANK_ADDRESS_BITS) + (word << (SDRAM_BANK_ADDRESS_BITS+SDRAM_ROW_ADDRESS_BITS));
+}
+
+{unsigned, unsigned, unsigned} unmakeWord(unsigned word) {
+ return {(word) & ((1<<SDRAM_BANK_ADDRESS_BITS)-1),
+ (word>>SDRAM_BANK_ADDRESS_BITS) & ((1<<SDRAM_ROW_ADDRESS_BITS)-1),
+ (word>>(SDRAM_BANK_ADDRESS_BITS+SDRAM_ROW_ADDRESS_BITS)) & ((1<<SDRAM_COL_ADDRESS_BITS)-1)};
+}
void pseudo_random_read(chanend server, unsigned test_limit) {
printf("Started pseudo_random_read\n");
{
Please sign in to comment.
Something went wrong with that request. Please try again.